OFFSET
0,4
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-3,0,1).
FORMULA
O.g.f.: ogf217(x^2) - 2*x*ogf217(x^2) = x^2/(1-x^2)^3 - 2*x^3/(1-x^2) = x^2*(1 - 2*x) / (1 - x^2)^3. - Georg Fischer, Nov 16 2022
From G. C. Greubel, Jan 22 2025: (Start)
a(n) = (1/16)*(2*(1-(-1)^n) + 2*(1+(-1)^n)*n - (1-3*(-1)^n)*n^2).
E.g.f.: (1/8)*(x-2)*(x*cosh(x) - (1+2*x)*sinh(x)). (End)
MAPLE
MATHEMATICA
CoefficientList[Series[x^2*(1 - 2*x)/(1 - x^2)^3, {x, 0, 35}], x] (* Georg Fischer, Nov 16 2022 *)
LinearRecurrence[{0, 3, 0, -3, 0, 1}, {0, 0, 1, -2, 3, -6}, 70] (* Harvey P. Dale, Jul 07 2024 *)
PROG
(Magma)
A131259:= func< n | (2*(n mod 2) +2*((n+1) mod 2)*n -((n mod 2) -(-1)^n)*n^2 )/8 >;
[A131259(n): n in [0..70]]; // G. C. Greubel, Jan 22 2025
(Python)
def A131259(n): return (2*(n%2) +2*((n+1)%2)*n -(3*(n%2)-1)*n**2)//8
print([A131259(n) for n in range(71)]) # G. C. Greubel, Jan 22 2025
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Sep 28 2007
EXTENSIONS
More terms from R. J. Mathar, Oct 26 2007
STATUS
approved
