OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,0,1,-4).
FORMULA
a(n) = 4*a(n-1) +a(n-3) -4*a(n-4).
G.f.: x*(1+x^2)/((1-x)*(1-4*x)*(1+x+x^2)). [Bruno Berselli, Jun 20 2012]
MATHEMATICA
LinearRecurrence[{4, 0, 1, -4}, {1, 4, 17, 69}, 30] (* Vincenzo Librandi, Jun 20 2012 *)
Table[FromDigits[PadRight[{}, n, {1, 0, 1}], 4], {n, 30}] (* Harvey P. Dale, Jul 17 2018 *)
PROG
(Magma) I:=[1, 4, 17, 69]; [n le 4 select I[n] else 4*Self(n-1)+Self(n-3)-4*Self(n-4): n in [1..30]]; // Vincenzo Librandi, Jun 20 2012
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved