login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A054844 Number of ways to write n as the sum of any number of consecutive integers (including the trivial one-term sum n = n). 10

%I

%S 2,2,4,2,4,4,4,2,6,4,4,4,4,4,8,2,4,6,4,4,8,4,4,4,6,4,8,4,4,8,4,2,8,4,

%T 8,6,4,4,8,4,4,8,4,4,12,4,4,4,6,6,8,4,4,8,8,4,8,4,4,8,4,4,12,2,8,8,4,

%U 4,8,8,4,6,4,4,12,4,8,8,4,4,10,4,4,8,8,4,8,4,4,12,8,4,8,4,8,4,4,6,12,6

%N Number of ways to write n as the sum of any number of consecutive integers (including the trivial one-term sum n = n).

%C a(n) = twice the number of odd divisors of n. That is, if d is the divisor function and q is the exponent of the largest power of 2 dividing n, then the a(n) equals 2*d(n)/(q+1). - _Andrew Niedermaier_, Jul 20 2003

%H Antti Karttunen, <a href="/A054844/b054844.txt">Table of n, a(n) for n = 1..65537</a>

%F a(n) = 2*A001227(n). - _Andrew Niedermaier_, Jul 20 2003

%F Moebius transform is period 2 sequence [2, 0, ...]. - _Michael Somos_, Sep 20 2005

%F G.f.: Sum_{k>0} 2x^k/(1-x^(2k)) = Sum_{k>0} 2x^(2k-1)/(1-x^(2k-1)). - _Michael Somos_, Sep 20 2005

%e a(3) = 4 because 3 = (-2)+(-1)+0+1+2+3 or 0+1+2 or 1+2 or 3; a(13) = 4 because 13 = (-12)+...+13 or (-5)+...+7 or 6+7 or 13.

%o (PARI) a(n)=2*sumdiv(n,d,d%2)

%o (PARI) A054844(n) = (2*numdiv(n>>valuation(n, 2))); \\ _Antti Karttunen_, Sep 27 2018

%Y Cf. A054843.

%K easy,nonn

%O 1,1

%A _Henry Bottomley_, Apr 13 2000

%E Corrected and extended by _Michael Somos_, Apr 26 2000

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 18 16:46 EDT 2019. Contains 324214 sequences. (Running on oeis4.)