OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,1,0,2).
FORMULA
a(2n) = (-1)^(n+1)*A084247(n).
a(2n+1) = -A078008(n).
a(2n) = -2*a(2n-1), n>0.
a(2n) + a(2n+1) = 2*(-1)^(n+1).
G.f.: (-1 -x +3*x^2 +x^3)/( (1-2*x^2)*(1+x^2) ). - R. J. Mathar, Jul 02 2011
a(n) = ((4*i^(n+1) - 2^((n+1)/2))*(1-(-1)^n) - 2*(4*i^n - 2^(n/2))*(1+(-1)^n))/12. - G. C. Greubel, Mar 30 2021
MATHEMATICA
LinearRecurrence[{0, 1, 0, 2}, {-1, -1, 2, 0}, 50] (* G. C. Greubel, Mar 30 2021 *)
Differences[LinearRecurrence[{0, 1, 0, 2}, {1, 0, -1, 1}, 70]] (* Harvey P. Dale, Sep 04 2024 *)
PROG
(Magma) I:=[-1, -1, 2, 0]; [n le 4 select I[n] else Self(n-2) +2*Self(n-4): n in [1..51]]; // G. C. Greubel, Mar 30 2021
(Sage) [((4*i^(n+1) - 2^((n+1)/2))*(1-(-1)^n) - 2*(4*i^n - 2^(n/2))*(1+(-1)^n))/12 for n in (0..50)] # G. C. Greubel, Mar 30 2021
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Aug 05 2008
STATUS
approved