OFFSET
0,8
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,1,0,2,0,-1).
FORMULA
From Colin Barker, Dec 16 2015: (Start)
a(n) = a(n-2) + 2*a(n-4) - a(n-6) for n>5.
G.f.: x^3*(1+x-x^2) / (1-x^2-2*x^4+x^6).
(End)
EXAMPLE
a(8) = a(7) + a(6)
= a(4) + a(3) + a(5) + a(4)
= (a(3) + a(2)) + a(3) + (a(2) + a(1)) + (a(3) + a(2))
= 1 + 1 + 0 + 1
= 3
MATHEMATICA
a[0] = a[1] = a[2] = 0; a[3] = 1; a[n_] := a[n] = If[EvenQ@ n, a[n - 1] + a[n - 2], a[n - 3] + a[n - 4]]; Table[a@ n, {n, 0, 55}] (* Michael De Vlieger, Dec 15 2015 *)
nxt[{n_, a_, b_, c_, d_}]:={n+1, b, c, d, If[OddQ[n], c+d, a+b]}; NestList[nxt, {1, 0, 0, 0, 1}, 60][[All, 2]] (* or *) LinearRecurrence[{0, 1, 0, 2, 0, -1}, {0, 0, 0, 1, 1, 0}, 60] (* Harvey P. Dale, Nov 10 2017 *)
PROG
(PARI) concat(vector(3), Vec(x^3*(1+x-x^2)/(1-x^2-2*x^4+x^6) + O(x^70))) \\ Colin Barker, Dec 16 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Nicholas Drozd, Dec 15 2015
EXTENSIONS
More terms from Michael De Vlieger, Dec 15 2015
STATUS
approved