OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (6,-13,13,-6,1).
FORMULA
From R. J. Mathar, Jan 08 2009: (Start)
G.f.: x^2*(2-x)/((1-3x+x^2)*(1-x)^3).
a(1)=0, a(2)=2, a(3)=11, a(4)=40, a(5)=123, a(n)=6*a(n-1)-13*a(n-2)+ 13*a(n-3)- 6*a(n-4)+a(n-5). - Harvey P. Dale, Mar 26 2015
MATHEMATICA
lst={}; a=b=s=0; Do[b+=n+a; a+=n+b; s+=a; AppendTo[lst, s], {n, 0, 2*4!}]; lst
Accumulate[LinearRecurrence[{5, -8, 5, -1}, {0, 2, 9, 29}, 30]] (* or *) LinearRecurrence[{6, -13, 13, -6, 1}, {0, 2, 11, 40, 123}, 30] (* Harvey P. Dale, Mar 26 2015 *)
PROG
(PARI) a(n)=([0, 1, 0, 0, 0; 0, 0, 1, 0, 0; 0, 0, 0, 1, 0; 0, 0, 0, 0, 1; 1, -6, 13, -13, 6]^(n-1)*[0; 2; 11; 40; 123])[1, 1] \\ Charles R Greathouse IV, May 30 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vladimir Joseph Stephan Orlovsky, Dec 14 2008
STATUS
approved
