OFFSET
0,4
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,2).
FORMULA
G.f.: (1-x)/(1-2*x^3).
a(n) = (-1)^floor(4n/3)*(2-2*0^mod(n+1,3))^floor((n+1)/3). - Wesley Ivan Hurt, May 09 2015
a(n) = (4^(n/6)/6)*(2 - 2^(2/3) + 2^(5/3)*sin(Pi*(2*n/3 + 5/6)) - 4*sin(Pi*(2*n/3 + 3/2))). - Eric Simon Jacob, Jul 14 2024
MAPLE
seq(op([2^n, -2^n, 0]), n=0..60); # Robert Israel, May 11 2015
MATHEMATICA
CoefficientList[Series[(1-x)/(1-2*x^3), {x, 0, 60}], x] (* Vincenzo Librandi, May 10 2015 *)
PROG
(Magma) &cat[[2^n, -2^n, 0]: n in [0..60]]; // Vincenzo Librandi, May 10 2015
(PARI) my(x='x+O('x^60)); Vec((1-x)/(1-2*x^3)) \\ G. C. Greubel, Aug 05 2019
(Sage) ((1-x)/(1-2*x^3)).series(x, 60).coefficients(x, sparse=False) # G. C. Greubel, Aug 05 2019
(GAP) a:=[1, -1, 0];; for n in [4..60] do a[n]:=2*a[n-3]; od; a; # G. C. Greubel, Aug 05 2019
CROSSREFS
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved