login
A053441
Moments of generalized Motzkin paths.
1
1, 0, 4, 4, 16, 24, 71, 128, 328, 650, 1552, 3232, 7437, 15904, 35884, 77840, 173792, 379896, 843411, 1851264, 4097552, 9014038, 19918944, 43871360, 96860441, 213472064, 471086932, 1038595100, 2291372912, 5052682904, 11145821407, 24580005376, 54217564504, 119573069218
OFFSET
2,3
LINKS
R. A. Sulanke, Moments of generalized Motzkin paths, J. Integer Sequences, Vol. 3 (2000), #00.1.
FORMULA
G.f.: x^2*(2*x^3+1)/((1+x)*(1+x-x^2)*(1-2*x-x^3)).
a(n) = 4*a(n-2) + 2*a(n-3) - a(n-6); a(2)=1, a(3)=0, a(4)=4, a(5)=4, a(6)=16, a(7)=24. - Harvey P. Dale, Oct 24 2011
MATHEMATICA
Drop[CoefficientList[Series[x^2(2x^3+1)/((1+x)(1+x-x^2)(1-2x-x^3)), {x, 0, 40}], x], 2] (* or *) LinearRecurrence[{0, 4, 2, 0, 0, -1}, {1, 0, 4, 4, 16, 24}, 40] (* Harvey P. Dale, Oct 24 2011 *)
PROG
(PARI) x='x+O('x^30); Vec(x^2*(2*x^3+1)/((1+x)*(1+x-x^2)*(1-2*x-x^3))) \\ G. C. Greubel, May 26 2018
(Magma) I:=[1, 0, 4, 4, 16, 24]; [n le 6 select I[n] else 4*Self(n-2) + 2*Self(n-3) -Self(n-6): n in [1..30]]; // G. C. Greubel, May 26 2018
CROSSREFS
Sequence in context: A223819 A082649 A156232 * A065732 A092959 A330054
KEYWORD
nonn,easy,nice
AUTHOR
N. J. A. Sloane, Jan 12 2000
EXTENSIONS
More terms from Reiner Martin, Oct 13 2002
STATUS
approved