OFFSET
0,2
COMMENTS
LINKS
Colin Barker,Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients,signature (2,-1,0,1).
FORMULA
MATHEMATICA
LinearRecurrence[{2, -1, 0, 1}, {0, 2, 2, 3}, 40] (* or *)
CoefficientList[Series[x (2 - 2 x + x^2)/((1 - x + x^2) (1 - x - x^2)), {x, 0, 39}], x] (*Michael De Vlieger,May 09 2017 *)
PROG
(PARI) concat(0, Vec(x*(2 - 2*x + x^2) / ((1 - x + x^2)*(1 - x - x^2)) + O(x^60))) \\Colin Barker,May 09 2017
(Magma) I:=[0, 2, 2, 3]; [n le 4 select I[n] else 2*Self(n-1) - Self(n-2) + Self(n-4): n in [1..30]]; //G. C. Greubel,Jan 15 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz,May 08 2017
EXTENSIONS
More terms fromColin Barker,May 09 2017
STATUS
approved