A131576 Number of ways to represent n as a sum of an even number of consecutive integers.
0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 2, 1, 1, 0, 1, 1, 2, 0, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 1, 2, 0, 2, 1, 1, 1, 1, 1, 2, 0, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, 3, 1, 1, 2, 1, 0, 2, 1, 1, 1, 2, 1, 2, 0, 1, 2, 1, 1, 2, 1, 2, 0, 1, 1, 2, 1, 1, 2, 1, 0, 4
Offset: 1
Examples
a(11)=1 because we have 11=5+6; a(21)=2 because we have 21=10+11=1+2+3+4+5+6; a(75)=3 because we have 75=37+38=10+11+12+13+14+15=3+4+5+6+7+8+9+10+11+12.
References
- M. D. Hirschhorn and P. M. Hirschhorn, Partitions into Consecutive Parts, Mathematics Magazine, 78:5 (2005), 396-398. [Please do not delete this reference. - N. J. A. Sloane, Dec 16 2020]
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
- M. D. Hirschhorn and P. M. Hirschhorn, Partitions into Consecutive Parts, Mathematics Magazine: 2005, Volume 78, Number 5, Pages: 396-397.
Programs
-
Maple
G:=sum(x^(k*(2*k+1))/(1-x^(2*k)), k=1..10): Gser:=series(G,x=0,85): seq(coeff(Gser,x,n),n=1..80); # Emeric Deutsch, Sep 08 2007 A131576 := proc(n) local dvs,a,k,r; dvs := numtheory[divisors](n) ; a := 0 ; for k in dvs do r := n/k+1 ; if r mod 2 = 0 then if r/2-k >= 1 then a := a+1 ; fi ; fi ; od: RETURN(a) ; end: seq(A131576(n),n=1..120) ; # R. J. Mathar, Sep 13 2007
-
Mathematica
With[{m = 105}, Rest@ CoefficientList[Series[Sum[x^(k (2 k + 1))/(1 - x^(2 k)), {k, m}], {x, 0, m}], x]] (* Michael De Vlieger, Mar 04 2018 *)
-
PARI
a(n) = my(s=sqrt(2*n)); sumdiv(n, d, (d % 2) && (d > s)); \\ Michel Marcus, Jan 15 2020
Formula
G.f.: Sum_{k>=1} x^(k*(2*k+1))/(1-x^(2*k)). [Corrected by N. J. A. Sloane, Dec 18 2020]
Conjectures: a(n) = (A001227(n) - A067742(n))/2 = A082647(n) - A067742(n). - Omar E. Pol, Feb 22 2017
Comments