OFFSET
0,3
COMMENTS
For n > 0, partial sums of A047201.
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,1,-2,1).
FORMULA
O.g.f.: -x*(1 + x + x^2 + x^3 + x^4)/((-1 + x)^3*(1 + x)*(1 + x^2)).
E.g.f.: (1/16)*(-exp(-x) + 5*exp(x)*(1 + 2*x + x^2) - 4*cos(x)).
a(n) = 2*a(n-1) - a(n-2) + a(n-4) -2*a(n-5) + a(n-6) for n > 5.
a(2*n-1) = A005891(n-1) for n > 0.
a(4*n) = 10*n^2. - Bernard Schott, Dec 06 2019
MAPLE
gf:=(1/16)*(-exp(-x) + 5*exp(x)*(1 + 2*x + 2*x^2) - 4*cos(x)); ser := series(gf, x, 54):
seq(factorial(n)*coeff(ser, x, n), n = 0 .. 53)
MATHEMATICA
Table[(1/16)*(5+(-1)^(1+n)-4*Cos[n*Pi/2]+10*n^2), {n, 0, 53}]
LinearRecurrence[{2, -1, 0, 1, -2, 1}, {0, 1, 3, 6, 10, 16}, 60] (* Harvey P. Dale, Jul 21 2021 *)
PROG
(Magma) I:=[0, 1, 3, 6, 10, 16]; [n le 6 select I[n] else 2*Self(n-1)-Self(n-2)+Self(n-4)-2*Self(n-5)+Self(n-6): n in [1..54]];
(PARI) concat([0], Vec(-x*(1 + x + x^2 + x^3 + x^4)/((-1 + x)^3*(1 + x)*(1 + x^2))+O(x^54)))
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Stefano Spezia, Dec 02 2019
STATUS
approved
