OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (8,-25,38,-28,8).
FORMULA
From Ralf Stephan, Sep 02 2003: (Start)
a(0) = 1, a(n) = (n^2 - n)*2^n/4 + n.
O.g.f.: 1+x*(-1+4*x-8*x^2+6*x^3) / ( (x-1)^2*(2*x-1)^3 ). - R. J. Mathar, Mar 22 2011
a(n) = 8*a(n-1) - 25*a(n-2) + 38*a(n-3) - 28*a(n-4) + 8*a(n-5); a(0)=1, a(1)=1, a(2)=4, a(3)=15, a(4)=52, a(5)=165. - Harvey P. Dale, Nov 01 2011
MATHEMATICA
With[{nn=30}, CoefficientList[Series[1+x Exp[x]+x^2 Exp[2x], {x, 0, nn}], x] Range[0, nn]!] (* or *) Join[{1}, LinearRecurrence[{8, -25, 38, -28, 8}, {1, 4, 15, 52, 165}, 30]] (* Harvey P. Dale, Nov 01 2011 *)
PROG
(PARI) a(n)=([0, 1, 0, 0, 0; 0, 0, 1, 0, 0; 0, 0, 0, 1, 0; 0, 0, 0, 0, 1; 8, -28, 38, -25, 8]^n*[1; 1; 4; 15; 52])[1, 1] \\ Charles R Greathouse IV, Jun 23 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved