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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A001227 Number of odd divisors of n. 100
1, 1, 2, 1, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 4, 1, 2, 3, 2, 2, 4, 2, 2, 2, 3, 2, 4, 2, 2, 4, 2, 1, 4, 2, 4, 3, 2, 2, 4, 2, 2, 4, 2, 2, 6, 2, 2, 2, 3, 3, 4, 2, 2, 4, 4, 2, 4, 2, 2, 4, 2, 2, 6, 1, 4, 4, 2, 2, 4, 4, 2, 3, 2, 2, 6, 2, 4, 4, 2, 2, 5, 2, 2, 4, 4, 2, 4, 2, 2, 6, 4, 2, 4, 2, 4, 2, 2, 3, 6, 3, 2, 4, 2, 2, 8 (list; graph; refs; listen; history; internal format)
OFFSET

1,3

COMMENTS

Also (1) number of ways to write n as difference of two triangular numbers (A000217); (2) number of ways to arrange n identical objects in a trapezoid. [Tom Verhoeff (Tom.Verhoeff(AT)acm.org)]

Also number of sums of sequences of consecutive positive integers including sequences of length 1 (e.g. 9 = 2+3+4 or 4+5 or 9 so a(9)=3). (Useful for cribbage players.) [Henry Bottomley, Apr 13 2000]

a(n) is also the number of factors in the factorization of the Chebyshev polynomial of thee first kind T_n(x). - Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 28 2003

Number of ways to present n as sum of consecutive integers. The trivial solution n=n is also counted. Equals 1 + A069283. - Alfred Heiligenbrunner (alfred.heiligenbrunner(AT)gmx.at), Jun 07 2004

Number of factors in the factorization of the polynomial x^n+1 over the integers. See also A000005. - T. D. Noe, Apr 16 2003

a(n)=1 for n=A000079. - Lekraj Beedassy, Apr 12 2005

For n odd, n is prime iff the n-th term of the sequence is 2. - George J. Schaeffer (gschaeff(AT)andrew.cmu.edu), Sep 10 2005

Also number of partitions of n such that if k is the largest part, then each of the parts 1,2,...,k-1 occurs exactly once. Example: a(9)=3 because we have [3,3,2,1],[2,2,2,2,1] and [1,1,1,1,1,1,1,1,1]. - Emeric Deutsch, Mar 07 2006

Also the number of factors of the n-th Lucas polynomial. - T. D. Noe, Mar 09 2006

REFERENCES

B. C. Berndt, Ramanujan's Notebooks Part V, Springer-Verlag, see p. 487 Entry 47.

L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 1, p. 306.

Graham, Knuth and Patashnik, Concrete Mathematics, 2nd ed. (Addison-Wesley, 1994), see exercise 2.30 on p. 65.

P. A. MacMahon, Combinatory Analysis, Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916; see vol. 2, p 28.

LINKS

N. J. A. Sloane, 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).

N. J. A. Sloane, Transforms

T. Verhoeff, Rectangular and Trapezoidal Arrangements, J. Integer Sequences, Vol. 2, 1999, #99.1.6.

Eric Weisstein's World of Mathematics, Odd Divisor Function

Eric Weisstein's World of Mathematics, Binomial Number

FORMULA

Dirichlet g.f.: zeta(s)^2*(1-1/2^s).

a(n) =A000005(n)/(A007814(n)+1) =A000005(n)/A001511(n).

Multiplicative with a(p^e) = 1 if p = 2; e+1 if p > 2. - David W. Wilson, Aug 01, 2001.

G.f.: Sum_{n>=1} x^n/(1-x^(2*n)). - Vladeta Jovovic (vladeta(AT)eunet.rs), Oct 16 2002

a(n)=A000005(A000265(n)). - Lekraj Beedassy, Jan 07 2005

G.f.: Sum_{k>0} x^(2k-1)/(1-x^(2k-1)) = Sum_{k>0} x^(k(k+1)/2)/(1-x^k). - Michael Somos Oct 30 2005

Moebius transform is period 2 sequence [1, 0, ...] = A000035, which means a(n) is the Dirichlet convolution of A000035 and A057427.

a(n) = A001826(n) + A001842(n). - Reinhard Zumkeller, Apr 18 2006

Sequence = M*V = A115369 * A000005, where M = an infinite lower triangular matrix and V = A000005, d(n); as a vector: [1, 2, 2, 3, 2, 4,...]. - Gary W. Adamson, Apr 15 2007

Number of occurrences of n in A049777. - Philippe DELEHAM, Jun 19 2005

Equals A051731 * [1,0,1,0,1,...]; where A051731 is the inverse Mobius transform. - Gary W. Adamson, Nov 06 2007

G.f.: x/(1-x) + sum(n=1,infinity, x^(3*n)/(1-x^(2*n)), also L(x)-L(x^2) where L(x) = sum(n>=1, x^n/(1-x^n). [From Joerg Arndt, Nov 06 2010]

a(n) = A000005(n) - A183063(n).

a(n) = d(n) if n is odd, else d(n) - d(n/2). (See the Weisstein page). - Gary W. Adamson, Mar 15 2011

Dirichlet convolution of A000005 and A154955 (interpreted as a flat sequence). - R. J. Mathar, Jun 28 2011

EXAMPLE

q + q^2 + 2*q^3 + q^4 + 2*q^5 + 2*q^6 + 2*q^7 + q^8 + 3*q^9 + 2*q^10 + ...

MAPLE

for n from 1 by 1 to 100 do s := 0: for d from 1 by 2 to n do if n mod d = 0 then s := s+1: fi: od: print(s); od:

MATHEMATICA

f[n_] := Block[{d = Divisors[n]}, Count[ OddQ[d], True]]; Table[ f[n], {n, 105}] (from Robert G. Wilson v Aug 27 2004)

Table[Total[Mod[Divisors[n], 2]], {n, 105}] [From Zak Seidov, Apr 16 2010]

f[n_] := Block[{d = DivisorSigma[0, n]}, If[ OddQ@ n, d, d - DivisorSigma[0, n/2]]]; Array[f, 105] (* RGWv *)

PROG

(PARI) {a(n) = if( n<1, 0, sumdiv(n, d, d%2))} /* Michael Somos Oct 06 2007 */

(PARI) {a(n) = if( n<1, 0, direuler( p=2, n, 1 / (1 - X) / (1 - kronecker( 4, p) * X))[n])} /* Michael Somos Oct 06 2007 */

(PARI) a(n)=numdiv(n>>valuation(n, 2)) \\ Charles R Greathouse IV, Mar 16, 2011

(Haskell)

a001227 n = length $ filter ((== 0) . mod n) [1, 3..n]

-- Reinhard Zumkeller, Jul 25 2011

(Sage)

def A001227(n) : return len(filter(is_odd, divisors(n)))

[A001227(n) for n in (1..80)]  # Peter Luschny, Feb 01 2012

CROSSREFS

Cf. A000005, A000593, A050999, A051000, A051001, A051002, A054844, A069283, A109814, A118235, A118236, A115369, A051731, A183063, A183064, A136655, A125911.

A113414(2*n) = a(n).

Cf. A183063.

Sequence in context: A035164 A023588 A175242 * A060764 A105149 A068307

Adjacent sequences:  A001224 A001225 A001226 * A001228 A001229 A001230

KEYWORD

nonn,easy,nice,mult,core,changed

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com).

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 15 04:23 EST 2012. Contains 205694 sequences.