OFFSET
1,16
COMMENTS
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.
Note that a(n) = 0 if 4n-1 is prime. - Alfred Heiligenbrunner, Mar 01 2016
LINKS
A. Heiligenbrunner, Tower-Sums of adjacent numbers (in German).
EXAMPLE
a(16)=2 because 16 = 5+6+5 and 16 = 1+2+3+4+3+2+1.
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.
MATHEMATICA
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}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Alfred Heiligenbrunner, Jun 15 2004
STATUS
approved