login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A213038
a(n) = n^2 - 3*floor(n/2)^2.
1
0, 1, 1, 6, 4, 13, 9, 22, 16, 33, 25, 46, 36, 61, 49, 78, 64, 97, 81, 118, 100, 141, 121, 166, 144, 193, 169, 222, 196, 253, 225, 286, 256, 321, 289, 358, 324, 397, 361, 438, 400, 481, 441, 526, 484, 573, 529, 622, 576, 673, 625, 726, 676, 781, 729, 838
OFFSET
0,4
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
Sequence in context: A006582 A263586 A180497 * A337512 A131828 A096038
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 06 2012
STATUS
approved