OFFSET
0,4
LINKS
Colin Barker, 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) = n*(-10 + 9*n - 4*n^2 + n^3)/4 for n > 1.
G.f.: x^3*(x^3 - 5*x^2 + 4*x - 6)/(x - 1)^5.
E.g.f.: x + exp(x)*x*(x^3 + 2*x^2 + 4*x - 4)/4. - Stefano Spezia, Jun 14 2023
EXAMPLE
a(5) = pg(3, 5) + pg(4, 5) + pg(5, 5) = 15 + 25 + 35 = 75.
PROG
(PARI) pg(m, n) = (n^2*(m-2)-n*(m-4))/2;
v=[]; for(n=0, 50, v=concat(v, sum(m=3, n, pg(m, n)))); v
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Colin Barker, Apr 22 2014
STATUS
approved