OFFSET
0,4
COMMENTS
This is also [0, 0, 0] together with the partial sums of the terms of A005900 that are greater than 1. - J. M. Bergot, Jun 02 2022
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Wikipedia, Polygonal number
Index entries for linear recurrences with constant coefficients, signature (5,-10,10,-5,1).
FORMULA
a(n) = (-6 - n + 2*n^2 - 2*n^3 + n^4)/6 for n>1.
G.f.: x^3*(x-3)*(x^2-x+2) / (x-1)^5.
EXAMPLE
a(5) = pg(5, 3) + pg(5, 4) + pg(5, 5) = 12 + 22 + 35 = 69.
MATHEMATICA
CoefficientList[Series[x^3 (x - 3) (x^2 - x + 2)/(x - 1)^5, {x, 0, 40}], x] (* Vincenzo Librandi, Aug 01 2014 *)
PROG
(PARI) pg(n, m) = (m^2*(n-2)-m*(n-4))/2
vector(50, n, sum(m=3, n-1, pg(n-1, m)))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Colin Barker, Jul 29 2014
STATUS
approved