OFFSET
2,2
COMMENTS
Records occur at indices 2, 3, 5, 7, 9, 15, 21, 45, 57, 81, 105, 145, 217, 225, 385, 435, 441, 495, 561, 651, 705, 945, 1105, ... - Peter Kagey, Nov 18 2020
LINKS
Peter Kagey, Table of n, a(n) for n = 2..5000
OEIS Wiki, Figurate numbers: Polygonal numbers
FORMULA
G.f.: Sum_{m>=1} (-x + Sum_{k>=1} x^A139601(m-1,k)/(1 - x^(m*k))).
EXAMPLE
For n = 7, the a(7) = 6 ways to write 7 as the difference of k-gonal numbers are:
MATHEMATICA
b := 74
CoefficientList[
Series[Sum[
Sum[x^(k*(p*k - (p - 2))/2)/(1 - x^(p*k)), {k, 1, b}] - x, {p, 1,
b - 1}], {x, 0, b}], x]
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Kagey, Apr 06 2020
STATUS
approved