OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,1,-4).
FORMULA
a(n) = 4a(n-1) + a(n-2) - 4a(n-3).
G.f.: x*(2+x) / ( (x-1)*(4*x-1)*(1+x) ). - R. J. Mathar, Nov 21 2011
MATHEMATICA
LinearRecurrence[{4, 1, -4}, {2, 9, 38}, 40] (* Vincenzo Librandi, Jun 22 2012 *)
PROG
(Magma) I:=[2, 9, 38]; [n le 3 select I[n] else 4*Self(n-1)+Self(n-2)-4*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jun 22 2012
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved