A012855 a(0) = 0, a(1) = 1, a(2) = 1; thereafter a(n) = 5*a(n-1) - 4*a(n-2) + a(n-3).
0, 1, 1, 1, 2, 7, 28, 114, 465, 1897, 7739, 31572, 128801, 525456, 2143648, 8745217, 35676949, 145547525, 593775046, 2422362079, 9882257736, 40315615410, 164471408185, 670976837021, 2737314167775, 11167134898976
Offset: 0
Keywords
Links
- Index entries for linear recurrences with constant coefficients, signature (5, -4, 1).
Programs
-
Maple
A012855 := proc(n,A,B,C) option remember; if n = 0 then A elif n = 1 then B elif n = 2 then C else 5*procname(n-1,A,B,C)-4*procname(n-2,A,B,C)+procname(n-3,A,B,C); fi; end; [ seq(A012855(i,0,1,1),i = 0..40) ]; # R. J. Mathar, Dec 30 2011
-
Mathematica
CoefficientList[Series[(4x^2-x)/(x^3-4x^2+5x-1),{x,0,40}],x] (* or *) LinearRecurrence[{5,-4,1},{0,1,1},40] (* Harvey P. Dale, Mar 28 2013 *)
-
PARI
a(n) = my(v=vector(n+1), u=[0,1,1]); for(k=1, n+1, v[k]=if(k<=3, u[k], 5*v[k-1] - 4*v[k-2] + v[k-3])); v[n+1] \\ Jianing Song, Feb 04 2019
Formula
a(n) = A000931(5*n-12) for n >= 3. - Alois P. Heinz, Feb 04 2019
G.f. (4x^2 - x)/(x^3 - 4x^2 + 5x - 1). For n > 2, a(n) = 1 + Sum_{k=0..n-3} A012814(k). - Ralf Stephan, Jan 15 2004
Extensions
Edited by N. J. A. Sloane, Feb 06 2019 at the suggestion of Jianing Song, replacing imprecise definition with formula from Harvey P. Dale, Mar 28 2013
Comments