OFFSET
1,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (4,-5,2,1,-2).
FORMULA
G.f.: x^2*(1 - 2*x + x^2 + x^3)/((2*x-1)*(x^2 + x - 1)*(x^2 - x + 1)).
a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3) + a(n-4) - 2*a(n-5).
MATHEMATICA
LinearRecurrence[{4, -5, 2, 1, -2}, {0, 1, 2, 4, 9}, 40] (* Vincenzo Librandi, Jun 20 2012 *)
CoefficientList[Series[x^2*(1-2*x+x^2+x^3)/((2*x-1)*(x^2+x-1)*(x^2-x+1)), {x, 0, 50}], x] (* G. C. Greubel, Jun 10 2017 *)
PROG
(Magma) I:=[0, 1, 2, 4, 9]; [n le 5 select I[n] else 4*Self(n-1)-5*Self(n-2)+2*Self(n-3)+Self(n-4)-2*Self(n-5): n in [1..40]]; // Vincenzo Librandi, Jun 20 2012
(PARI) x='x+O('x^50); Vec(x^2*(1-2*x+x^2+x^3)/((2*x-1)*(x^2+x-1)*(x^2-x+1))) \\ G. C. Greubel, Jun 10 207
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Typo in denominator of g.f. corrected by R. J. Mathar, Sep 03 2010
STATUS
approved