OFFSET
0,3
COMMENTS
Also, a(n) = n^2 + floor(2*n^2/3), since 2*floor(n^2/3) = floor(2*n^2/3).
LINKS
Bruno Berselli, Table of n, a(n) for n = 0..1000
Tadeusz Dorozinskis, Pentagonpolyhedra Doro
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
G.f.: x*(1+x)*(1 + 3*x + x^2)/((1 + x + x^2)*(1-x)^3).
a(n) = a(-n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5).
a(n) = floor(5*n^2/3). - Wesley Ivan Hurt, Mar 16 2015
a(n) = a(n-3) + 5*(2n-3) [Tadeusz Dorozinski]. - Eduard Baumann, Jan 18 2023
MATHEMATICA
Table[n^2 + 2 Floor[n^2/3], {n, 0, 50}]
CoefficientList[Series[x (1 + x) (1 + 3 x + x^2) / ((1 + x + x^2) (1 - x)^3), {x, 0, 50}], x] (* Vincenzo Librandi, Aug 18 2013 *)
LinearRecurrence[{2, -1, 1, -2, 1}, {0, 1, 6, 15, 26}, 50] (* Hugo Pfoertner, Jan 17 2023 *)
PROG
(Magma) [n^2+2*Floor(n^2/3): n in [0..50]];
(Magma) I:=[0, 1, 6, 15, 26]; [n le 5 select I[n] else 2*Self(n-1)-Self(n-2)+Self(n-3)-2*Self(n-4)+Self(n-5): n in [1..50]]; // Vincenzo Librandi, Aug 18 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Aug 08 2013
STATUS
approved