OFFSET
1,15
COMMENTS
Powers of 2 and (odd) primes cannot be written as a sum of at least three consecutive integers. a(n) strongly depends on the number of odd divisors of n (A001227): Suppose n is to be written as sum of k consecutive integers starting with m, then 2n = k(2m + k - 1). Only one of the factors is odd. For each odd divisor of n there is a unique corresponding k, k=1 and k=2 must be excluded.
When the initial 0 term is a(1), a(n) is the number of times n occurs after the second column in the square array of A049777. - Bob Selcoe, Feb 14 2014
For nonnegative integers x,y where x-y>=3: a(n) equals the number of ways n can be expressed as a function of (x*(x+1)-y*(y+1))/2 when the initial 0 term is a(1). - Bob Selcoe, Feb 14 2014
REFERENCES
Nieuw Archief voor Wiskunde 5/6 nr. 2 Problems/UWC Problem C part 4, Jun 2005, p. 181-182
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
K. S. Brown's Mathpages, Partitions into Consecutive Integers
A. Heiligenbrunner, Sum of adjacent numbers (in German)
Nieuw Archief voor Wiskunde 5/6 nr. 2 Problems/UWC, Problem C: solution of this Problem
J. Spies, Sage program for computing A111775
FORMULA
G.f.: Sum_{n >= 2} x^(3*n)/(1 - x^(2*n)). - Peter Bala, Jan 12 2021
EXAMPLE
a(15) = 2 because 15 = 4+5+6 and 15 = 1+2+3+4+5. The number of odd divisors of 15 is 4.
G.f. = x^6 + x^9 + x^10 + x^12 + x^14 + 2*x^15 + 2*x^18 + x^20 + 2*x^21 + x^22 + ...
a(30) = 3 because there are 3 ways to satisfy (x*(x+1)-y*(y+1))/2 = 30 when x-y>=3: x=8, y=3; x=9, y=5; and x=11, y=8. - Bob Selcoe, Feb 14 2014
MAPLE
MATHEMATICA
a[n_] := If[n == 1, 0, Total[Mod[Divisors[n], 2]] - Mod[n, 2] - 1];
a /@ Range[1, 100] (* Jean-François Alcover, Oct 14 2019 *)
PROG
(PARI) {a(n) = local(m); if( n<1, 0, sum( i=0, n, m=0; if( issquare( 1 + 8*(n + i * (i + 1)/2), &m), m\2 > i+2)))}; /* Michael Somos, Aug 27 2012 */
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jaap Spies, Aug 16 2005
STATUS
approved