login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) is the number of ways to write n as the difference of two centered k-gonal numbers for k >= 3.
1

%I #17 Nov 20 2020 03:10:05

%S 0,0,1,1,1,2,1,2,3,2,1,5,1,2,5,3,1,6,1,5,5,2,1,8,3,2,6,5,1,10,1,4,5,2,

%T 5,12,1,2,5,8,1,10,1,5,12,2,1,11,3,6,5,5,1,12,5,8,5,2,1,19,1,2,12,5,5,

%U 10,1,5,5,10,1,18,1,2,12,5,5,10,1,11,10,2

%N a(n) is the number of ways to write n as the difference of two centered k-gonal numbers for k >= 3.

%C Records occur at indices n = 1, 3, 6, 9, 12, 18, 24, 30, 36, 60, 90, 120, 180, 270, 360, 420, 540, 630, 840, 1080, ...

%H Peter Kagey, <a href="/A339010/b339010.txt">Table of n, a(n) for n = 1..10000</a>

%H Code Golf Stack Exchange, <a href="https://codegolf.stackexchange.com/q/215386/53884">Uncentered Polygons</a>

%H OEIS Wiki, <a href="http://oeis.org/wiki/Centered_polygonal_numbers">Centered polygonal numbers</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CenteredPolygonalNumber.html">Centered Polygonal Number</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Centered_polygonal_number">Centered polygonal number</a>

%F a(n) = Sum_{d|n, 3*d <= n} A001227(d).

%e For n = 35, the a(35) = 5 differences are:

%e A101321( 5,4) - A101321( 5,2) = 51 - 16 = 35,

%e A101321( 5,7) - A101321( 5,6) = 141 - 106 = 35,

%e A101321( 7,3) - A101321( 7,1) = 43 - 8 = 35,

%e A101321( 7,5) - A101321( 7,4) = 106 - 71 = 35, and

%e A101321(36,1) - A101321(36,0) = 36 - 1 = 35.

%o (PARI) a(n) = sumdiv(n, d, if (3*d <= n, numdiv(d>>valuation(d, 2)))); \\ _Michel Marcus_, Nov 19 2020

%Y Cf. A001227, A101321.

%Y Cf. A333822 (polygonal numbers), A333836 (positive polygonal numbers), A333868 (binomial coefficients), A333880 (perfect powers).

%K nonn

%O 1,6

%A _Peter Kagey_, Nov 18 2020