A111775 Number of ways n can be written as a sum of at least three consecutive integers.
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
Offset: 1
Examples
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
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
Programs
-
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 *)
-
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 */
Formula
G.f.: Sum_{n >= 2} x^(3*n)/(1 - x^(2*n)). - Peter Bala, Jan 12 2021
Comments