OFFSET
2,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 2..1000
R. A. Sulanke, Moments of generalized Motzkin paths, J. Integer Sequences, Vol. 3 (2000), #00.1.
Index entries for linear recurrences with constant coefficients, signature (0,4,2,0,0,-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
KEYWORD
nonn,easy,nice
AUTHOR
N. J. A. Sloane, Jan 12 2000
EXTENSIONS
More terms from Reiner Martin, Oct 13 2002
STATUS
approved