OFFSET
0,4
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
G.f.: x*(1+3*x^2-2*x^3) / ((1-x)^3*(1+x)^2). [Corrected by Colin Barker, Jan 26 2016]
a(n) = ( 2*n*(n+3) - 3*(2*n-1)*(-1)^n - 3 )/8. [Bruno Berselli, Jan 26 2016]
MATHEMATICA
a[n_] := n^2 - 3 Floor[n/2]^2
Table[a[n], {n, 0, 90}] (* A213038 *)
LinearRecurrence[{1, 2, -2, -1, 1}, {0, 1, 1, 6, 4}, 60] (* Harvey P. Dale, Sep 22 2019 *)
PROG
(PARI) concat(0, Vec(x*(1+3*x^2-2*x^3)/((1-x)^3*(1+x)^2) + O(x^100))) \\ Colin Barker, Jan 26 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 06 2012
STATUS
approved