The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A111775 Number of ways n can be written as a sum of at least three consecutive integers. 4
0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 2, 0, 0, 2, 0, 1, 2, 1, 0, 1, 1, 1, 2, 1, 0, 3, 0, 0, 2, 1, 2, 2, 0, 1, 2, 1, 0, 3, 0, 1, 4, 1, 0, 1, 1, 2, 2, 1, 0, 3, 2, 1, 2, 1, 0, 3, 0, 1, 4, 0, 2, 3, 0, 1, 2, 3, 0, 2, 0, 1, 4, 1, 2, 3, 0, 1, 3, 1, 0, 3, 2, 1, 2, 1, 0, 5, 2, 1, 2, 1, 2, 1, 0, 2, 4, 2, 0, 3, 0, 1 (list; graph; refs; listen; history; text; internal format)
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
K. S. Brown's Mathpages, Partitions into Consecutive Integers
Nieuw Archief voor Wiskunde 5/6 nr. 2 Problems/UWC, Problem C: solution of this Problem
FORMULA
If n is even then a(n) = A001227(n)-1 = A069283(n) otherwise a(n) = A001227(n)-2, for n > 1.
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
A001227:= proc(n) local d, s; s := 0: for d from 1 by 2 to n do if n mod d = 0 then s:=s+1 fi: end do: return(s); end proc; A111775:= proc(n) local k; if n=1 then return(0) fi: k := A001227(n): if type(n, even) then k:=k-1 else k:=k-2 fi: return k; end proc; seq(A111775(i), i=1..150);
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
Cf. A111774, A001227 (number of odd divisors), A069283.
Sequence in context: A161116 A262726 A112605 * A325166 A025844 A035461
KEYWORD
easy,nonn
AUTHOR
Jaap Spies, Aug 16 2005
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 17 23:39 EDT 2024. Contains 372608 sequences. (Running on oeis4.)