cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Henry Bottomley, Apr 13 2000

Keywords

Comments

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
Moebius transform is period 2 sequence [2, 0, ...]. - Michael Somos, Sep 20 2005
a(n) is twice the number of partitions of n into consecutive parts. - Omar E. Pol, Nov 28 2020

Examples

			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.
From _Omar E. Pol_, Nov 28 2020: (Start)
Illustration of initial terms:
                                        Diagram
n   a(n)                                  _ _
1     2                                 _|1 1|_
2     2                               _|1 _ _ 1|_
3     4                             _|1  |1 1|  1|_
4     2                           _|1   _|   |_   1|_
5     4                         _|1    |1 _ _ 1|    1|_
6     4                       _|1     _| |1 1| |_     1|_
7     4                     _|1      |1  |   |  1|      1|_
8     2                   _|1       _|  _|   |_  |_       1|_
9     6                 _|1        |1  |1 _ _ 1|  1|        1|_
10    4               _|1         _|   | |1 1| |   |_         1|_
11    4             _|1          |1   _| |   | |_   1|          1|_
12    4           _|1           _|   |1  |   |  1|   |_           1|_
13    4         _|1            |1    |  _|   |_  |    1|            1|_
14    4       _|1             _|    _| |1 _ _ 1| |_    |_             1|_
15    8     _|1              |1    |1  | |1 1| |  1|    1|              1|_
16    2    |1                |     |   | |   | |   |     |                1|
...
a(n) is the number of horizontal toothpicks in the n-th level of the diagram. (End)
		

Crossrefs

Programs

  • PARI
    a(n)=2*sumdiv(n,d,d%2)
    
  • PARI
    A054844(n) = (2*numdiv(n>>valuation(n, 2))); \\ Antti Karttunen, Sep 27 2018

Formula

a(n) = 2*A001227(n). - Andrew Niedermaier, Jul 20 2003
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
a(n) = A010054(n) + A335616(n). - Omar E. Pol, Nov 28 2020

Extensions

Corrected and extended by Michael Somos, Apr 26 2000