OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,1,3,1).
FORMULA
G.f.: (1+x+x^2)/(1-x^2-3x^3-x^4). - Ralf Stephan, Apr 30 2004
a(n) = a(n-2) + 3*a(n-3) + a(n-4) for n>3. - Vincenzo Librandi, Jun 19 2014
MATHEMATICA
LinearRecurrence[{0, 1, 3, 1}, {1, 1, 2, 4}, 40] (* Harvey P. Dale, Jun 18 2014 *)
CoefficientList[Series[(1 + x + x^2)/(1 - x^2 - 3 x^3 - x^4), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 19 2014 *)
PROG
(Magma) I:=[1, 1, 2, 4]; [n le 4 select I[n] else Self(n-2)+3*Self(n-3)+Self(n-4): n in [1..40]]; // Vincenzo Librandi, Jun 19 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved