login
Number of ways to write n in the form m + (m+1) + ... + (m+k-1) + (m+k) + (m+k-1) + ... + (m+1) + m with integers m>= 1, k>=1. Or, number of divisors a of 4n-1 with 0 < (a-1)^2 < 4n.
1

%I #15 Mar 01 2016 03:16:29

%S 0,0,0,1,0,0,1,0,1,1,0,0,1,1,0,2,0,0,2,0,0,1,1,1,2,0,0,1,1,1,1,0,0,3,

%T 0,1,2,0,1,1,0,0,2,2,0,1,1,0,3,0,1,2,0,1,1,0,0,3,1,0,2,1,0,3,1,0,1,0,

%U 2,2,0,1,1,1,1,1,0,0,5,1,1,1,0,1,1,1,0,3,1,0,2,0,1,3,0,0,2,1,1,3

%N Number of ways to write n in the form m + (m+1) + ... + (m+k-1) + (m+k) + (m+k-1) + ... + (m+1) + m with integers m>= 1, k>=1. Or, number of divisors a of 4n-1 with 0 < (a-1)^2 < 4n.

%C n = m + (m+1) + ... + (m+k-1) + (m+k) + (m+k-1) + ... + (m+1) + m means n = k^2 + m*(2k+1) or 4n-1 = (2k+1)*(4m+2k-1). So if 4n-1 disparts into two odd factors a*b, then k = (a-1)/2, m=(n-k^2)/(2k+1) give the solution of the origin equation. We only count solutions with k^2 < n, such that m>0. This means we are taking into account only factors a < 2n+1.

%C Note that a(n) = 0 if 4n-1 is prime. - _Alfred Heiligenbrunner_, Mar 01 2016

%H A. Heiligenbrunner, <a href="http://ah9.at/ahsumm2.htm">Tower-Sums of adjacent numbers</a> (in German).

%e a(16)=2 because 16 = 5+6+5 and 16 = 1+2+3+4+3+2+1.

%e The trivial case 16=16 (k=0, m=n) is not counted. The cases m=0, e.g. 16 = 0+1+2+3+4+3+2+1+0 are not counted. The cases m<0 e.g. 16 = -4+-3+-2+-1+0+1+2+3+4+5+6+5+4+3+2+1+0+-1+-2+-3+-4 are not counted.

%t h1 = Table[count = 0; For[k = 1, k^2 < n, k++, If[Mod[n - k^2, 2k + 1] == 0, count++ ]]; count, {n, 100}] - or - h2 = Table[Length[Select[Divisors[4n - 1], ((# - 1)^2 < 4n) &]] - 1, {n, 100}]

%Y Cf. A069283, A001227.

%K nonn

%O 1,16

%A _Alfred Heiligenbrunner_, Jun 15 2004