OFFSET
0,4
COMMENTS
Old definition was: "Starting with 0, 1, 2, 3, ... (A001477), write 0, 0 instead of a(0), 1, 1 instead of a(3) and in general n, n instead of a(3n)".
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-3,4,-3,2,-1).
FORMULA
From Colin Barker, May 30 2016: (Start)
G.f.: x^2*(1+x)*(1-x+x^2) / ((1-x)^2*(1+x^2)^2).
a(n) = (-2+(-i)^n+i^n+(4-(1+i)*(-i)^n-(1-i)*i^n)*n)/8 where i = sqrt(-1).
a(n) = 2*a(n-1)-3*a(n-2)+4*a(n-3)-3*a(n-4)+2*a(n-5)-a(n-6) for n>5. (End)
MATHEMATICA
LinearRecurrence[{2, -3, 4, -3, 2, -1}, {0, 0, 1, 2, 1, 1}, 50] (* G. C. Greubel, May 29 2016 *)
PROG
(PARI) concat(vector(2), Vec(x^2*(1+x)*(1-x+x^2)/((1-x)^2*(1+x^2)^2) + O(x^50))) \\ Colin Barker, May 30 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Jan 13 2008
EXTENSIONS
New name using the g.f. from Colin Barker, May 30 2016
STATUS
approved