OFFSET
0,3
COMMENTS
With the similar remainder 1, 2 and 3 sequences provides a four-fold partition of A000027.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,2,0,0,0,-1).
FORMULA
a(n) = Sum_{k=0..n} if (k*n mod 4 = 0, 1, 0).
From Colin Barker, May 03 2015: (Start)
a(n) = (6+4*n+i^n*(-i+n)+(-i)^n*(i+n)+2*(-1)^n*(1+n))/8 where i=sqrt(-1).
a(n) = 2*a(n-4)-a(n-8) for n>7.
G.f.: (3*x^4+x^3+2*x^2+x+1) / ((x-1)^2*(x+1)^2*(x^2+1)^2).
(End)
MATHEMATICA
CoefficientList[Series[(3 x^4 + x^3 + 2 x^2 + x + 1)/((x - 1)^2 (x + 1)^2 (x^2 + 1)^2), {x, 0, 80}], x] (* Vincenzo Librandi, May 03 2015 *)
PROG
(PARI) Vec((3*x^4+x^3+2*x^2+x+1)/((x-1)^2*(x+1)^2*(x^2+1)^2) + O(x^100)) \\ Colin Barker, May 03 2015
(Magma) I:=[1, 1, 2, 1, 5, 2, 4, 2]; [n le 8 select I[n] else 2*Self(n-4)-Self(n-8): n in [1..80]]; // Vincenzo Librandi, May 03 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Sep 13 2003
STATUS
approved