login
Number of ways to write n as the difference of two k-gonal numbers for k >= 3.
5

%I #18 Nov 19 2020 22:33:59

%S 1,3,3,5,4,6,4,8,5,7,6,8,5,10,7,9,6,8,6,13,8,8,7,12,6,12,8,10,9,10,7,

%T 13,8,12,10,13,6,13,9,12,8,10,8,17,11,10,10,14,8,16,9,10,9,14,10,19,9,

%U 8,10,14,7,16,12,19,12,12,7,14,12,12,11,14,8

%N Number of ways to write n as the difference of two k-gonal numbers for k >= 3.

%C 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

%H Peter Kagey, <a href="/A333822/b333822.txt">Table of n, a(n) for n = 2..5000</a>

%H OEIS Wiki, <a href="http://oeis.org/wiki/Figurate_numbers#Polygonal_numbers">Figurate numbers: Polygonal numbers</a>

%F G.f.: Sum_{m>=1} (-x + Sum_{k>=1} x^A139601(m-1,k)/(1 - x^(m*k))).

%e For n = 7, the a(7) = 6 ways to write 7 as the difference of k-gonal numbers are:

%e A000217(4) - A000217(2) = 10 - 3 (triangular),

%e A000217(7) - A000217(6) = 28 - 21 (triangular),

%e A000290(4) - A000290(3) = 16 - 9 (square),

%e A000326(3) - A000326(2) = 12 - 5 (pentagonal),

%e A000566(2) - A000566(0) = 7 - 0 (heptagonal), and

%e A000567(2) - A000567(1) = 8 - 1 (octagonal).

%t b := 74

%t CoefficientList[

%t Series[Sum[

%t Sum[x^(k*(p*k - (p - 2))/2)/(1 - x^(p*k)), {k, 1, b}] - x, {p, 1,

%t b - 1}], {x, 0, b}], x]

%Y Cf. A000217, A000290, A000326, A000566, A000567, A139601.

%Y Cf. A177025.

%Y Analogous sequences for specific values of k: A001227 (k=3), A034178 (k=4), A333815 (k=5), A333816 (k=6), A333817 (k=7), A333818 (k=8).

%K nonn

%O 2,2

%A _Peter Kagey_, Apr 06 2020