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.
%I A001227 #353 Jul 25 2025 15:40:01 %S A001227 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, %T A001227 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, %U A001227 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 %N A001227 Number of odd divisors of n. %C A001227 Also (1) number of ways to write n as difference of two triangular numbers (A000217), see A136107; (2) number of ways to arrange n identical objects in a trapezoid. - _Tom Verhoeff_ %C A001227 Also number of partitions of n into consecutive positive integers including the trivial partition of length 1 (e.g., 9 = 2+3+4 or 4+5 or 9 so a(9)=3). (Useful for cribbage players.) See A069283. - _Henry Bottomley_, Apr 13 2000 %C A001227 This has been described as Sylvester's theorem, but to reduce ambiguity I suggest calling it Sylvester's enumeration. - _Gus Wiseman_, Oct 04 2022 %C A001227 a(n) is also the number of factors in the factorization of the Chebyshev polynomial of the first kind T_n(x). - Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 28 2003 %C A001227 Number of factors in the factorization of the polynomial x^n+1 over the integers. See also A000005. - _T. D. Noe_, Apr 16 2003 %C A001227 a(n) = 1 if and only if n is a power of 2 (see A000079). - _Lekraj Beedassy_, Apr 12 2005 %C A001227 Number of occurrences of n in A049777. - _Philippe Deléham_, Jun 19 2005 %C A001227 For n odd, n is prime if and only if a(n) = 2. - George J. Schaeffer (gschaeff(AT)andrew.cmu.edu), Sep 10 2005 %C A001227 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 %C A001227 Also the number of factors of the n-th Lucas polynomial. - _T. D. Noe_, Mar 09 2006 %C A001227 Lengths of rows of triangle A182469; %C A001227 Denoted by Delta_0(n) in Glaisher 1907. - _Michael Somos_, May 17 2013 %C A001227 Also the number of partitions p of n into distinct parts such that max(p) - min(p) < length(p). - _Clark Kimberling_, Apr 18 2014 %C A001227 Row sums of triangle A247795. - _Reinhard Zumkeller_, Sep 28 2014 %C A001227 Row sums of triangle A237048. - _Omar E. Pol_, Oct 24 2014 %C A001227 A069288(n) <= a(n). - _Reinhard Zumkeller_, Apr 05 2015 %C A001227 A000203, A000593 and this sequence have the same parity: A053866. - _Omar E. Pol_, May 14 2016 %C A001227 a(n) is equal to the number of ways to write 2*n-1 as (4*x + 2)*y + 4*x + 1 where x and y are nonnegative integers. Also a(n) is equal to the number of distinct values of k such that k/(2*n-1) + k divides (k/(2*n-1))^(k/(2*n-1)) + k, (k/(2*n-1))^k + k/(2*n-1) and k^(k/(2*n-1)) + k/(2*n-1). - _Juri-Stepan Gerasimov_, May 23 2016, Jul 15 2016 %C A001227 Also the number of odd divisors of n*2^m for m >= 0. - _Juri-Stepan Gerasimov_, Jul 15 2016 %C A001227 a(n) is odd if and only if n is a square or twice a square. - _Juri-Stepan Gerasimov_, Jul 17 2016 %C A001227 a(n) is also the number of subparts in the symmetric representation of sigma(n). For more information see A279387 and A237593. - _Omar E. Pol_, Nov 05 2016 %C A001227 a(n) is also the number of partitions of n into an odd number of equal parts. - _Omar E. Pol_, May 14 2017 [This follows from the g.f. Sum_{k >= 1} x^k/(1-x^(2*k)). - _N. J. A. Sloane_, Dec 03 2020] %D A001227 B. C. Berndt, Ramanujan's Notebooks Part V, Springer-Verlag, see p. 487 Entry 47. %D A001227 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. %D A001227 J. W. L. Glaisher, On the representations of a number as the sum of two, four, six, eight, ten, and twelve squares, Quart. J. Math. 38 (1907), 1-62 (see p. 4). %D A001227 Ronald. L. Graham, Donald E. Knuth, and Oren Patashnik, Concrete Mathematics, 2nd ed. (Addison-Wesley, 1994), see exercise 2.30 on p. 65. %D A001227 P. A. MacMahon, Combinatory Analysis, Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916; see vol. 2, p 28. %H A001227 N. J. A. Sloane, <a href="/A001227/b001227.txt">Table of n, a(n) for n = 1..10000</a> %H A001227 K. S. Brown's Mathpages, <a href="http://www.mathpages.com/home/kmath107.htm">Partitions into Consecutive Integers</a>. %H A001227 Atli Fannar Franklín, <a href="https://arxiv.org/abs/2410.07467">Pattern avoidance enumerated by inversions</a>, arXiv:2410.07467 [math.CO], 2024. See pp. 2, 18. %H A001227 J. W. L. Glaisher, <a href="https://books.google.com/books?id=bLs9AQAAMAAJ&pg=RA1-PA1">On the representations of a number as the sum of two, four, six, eight, ten, and twelve squares</a>, Quart. J. Math. 38 (1907), 1-62 (see p. 4 and p. 8). %H A001227 A. Heiligenbrunner, <a href="http://ah9.at/ahsummen.htm">Sum of adjacent numbers (in German)</a>. %H A001227 Christian Kassel and Christophe Reutenauer, <a href="https://arxiv.org/abs/2507.15780">Pairs of intertwined integer sequences</a>, arXiv:2507.15780 [math.NT], 2025. See p. 11. %H A001227 Gerzson Kéri, <a href="http://ac.inf.elte.hu/Vol_053_2022/093_53.pdf">The factorization of compressed Chebyshev polynomials and other polynomials related to multiple-angle formulas</a>, Annales Univ. Sci. Budapest (Hungary, 2022) Sect. Comp., Vol. 53, 93-108. %H A001227 Mircea Merca, <a href="http://dx.doi.org/10.1016/j.jnt.2015.08.014">Combinatorial interpretations of a recent convolution for the number of divisors of a positive integer</a>, Journal of Number Theory, Volume 160, March 2016, Pages 60-75, function tau_o(n). %H A001227 M. A. Nyblom, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/39-3/nyblom.pdf">On the representation of the integers as a difference of nonconsecutive triangular numbers</a>, Fibonacci Quarterly 39:3 (2001), pp. 256-263. %H A001227 R. C. Read, <a href="/A000684/a000684_1.pdf">Letter to N. J. A. Sloane, Oct. 29, 1976</a>. %H A001227 N. J. A. Sloane, <a href="/transforms.txt">Transforms</a>. %H A001227 T. Verhoeff, <a href="http://www.cs.uwaterloo.ca/journals/JIS/trapzoid.html">Rectangular and Trapezoidal Arrangements</a>, J. Integer Sequences, Vol. 2 (1999), Article 99.1.6. %H A001227 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/BinomialNumber.html">Binomial Number</a> and <a href="https://mathworld.wolfram.com/OddDivisorFunction.html">Odd Divisor Function</a>. %H A001227 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/q-PolygammaFunction.html">q-Polygamma Function</a>. %H A001227 <a href="/index/Cor#core">Index entries for "core" sequences</a>. %H A001227 <a href="/index/Ge#Glaisher">Index entries for sequences mentioned by Glaisher</a>. %F A001227 Dirichlet g.f.: zeta(s)^2*(1-1/2^s). %F A001227 Comment from _N. J. A. Sloane_, Dec 02 2020: (Start) %F A001227 By counting the odd divisors f n in different ways, we get three different ways of writing the ordinary generating function. It is: %F A001227 A(x) = x + x^2 + 2*x^3 + x^4 + 2*x^5 + 2*x^6 + 2*x^7 + x^8 + 3*x^9 + 2*x^10 + ... %F A001227 = Sum_{k >= 1} x^(2*k-1)/(1-x^(2*k-1)) %F A001227 = Sum_{k >= 1} x^k/(1-x^(2*k)) %F A001227 = Sum_{k >= 1} x^(k*(k+1)/2)/(1-x^k) [Ramanujan, 2nd notebook, p. 355.]. %F A001227 (This incorporates comments from _Vladeta Jovovic_, Oct 16 2002 and _Michael Somos_, Oct 30 2005.) (End) %F A001227 G.f.: x/(1-x) + Sum_{n>=1} x^(3*n)/(1-x^(2*n)), also L(x)-L(x^2) where L(x) = Sum_{n>=1} x^n/(1-x^n). - _Joerg Arndt_, Nov 06 2010 %F A001227 a(n) = A000005(n)/(A007814(n)+1) = A000005(n)/A001511(n). %F A001227 Multiplicative with a(p^e) = 1 if p = 2; e+1 if p > 2. - _David W. Wilson_, Aug 01 2001 %F A001227 a(n) = A000005(A000265(n)). - _Lekraj Beedassy_, Jan 07 2005 %F A001227 Moebius transform is period 2 sequence [1, 0, ...] = A000035, which means a(n) is the Dirichlet convolution of A000035 and A057427. %F A001227 a(n) = A113414(2*n). - _N. J. A. Sloane_, Jan 24 2006 (corrected Nov 10 2007) %F A001227 a(n) = A001826(n) + A001842(n). - _Reinhard Zumkeller_, Apr 18 2006 %F A001227 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 %F A001227 Equals A051731 * [1,0,1,0,1,...]; where A051731 is the inverse Mobius transform. - _Gary W. Adamson_, Nov 06 2007 %F A001227 a(n) = A000005(n) - A183063(n). %F A001227 a(n) = d(n) if n is odd, or d(n) - d(n/2) if n is even, where d(n) is the number of divisors of n (A000005). (See the Weisstein page.) - _Gary W. Adamson_, Mar 15 2011 %F A001227 Dirichlet convolution of A000005 and A154955 (interpreted as a flat sequence). - _R. J. Mathar_, Jun 28 2011 %F A001227 a(A000079(n)) = 1; a(A057716(n)) > 1; a(A093641(n)) <= 2; a(A038550(n)) = 2; a(A105441(n)) > 2; a(A072502(n)) = 3. - _Reinhard Zumkeller_, May 01 2012 %F A001227 a(n) = 1 + A069283(n). - _R. J. Mathar_, Jun 18 2015 %F A001227 a(A002110(n)/2) = n, n >= 1. - _Altug Alkan_, Sep 29 2015 %F A001227 a(n*2^m) = a(n*2^i), a((2*j+1)^n) = n+1 for m >= 0, i >= 0 and j >= 0. a((2*x+1)^n) = a((2*y+1)^n) for positive x and y. - _Juri-Stepan Gerasimov_, Jul 17 2016 %F A001227 Conjectures: a(n) = A067742(n) + 2*A131576(n) = A082647(n) + A131576(n). - _Omar E. Pol_, Feb 15 2017 %F A001227 a(n) = A000005(2n) - A000005(n) = A099777(n)-A000005(n). - _Danny Rorabaugh_, Oct 03 2017 %F A001227 L.g.f.: -log(Product_{k>=1} (1 - x^(2*k-1))^(1/(2*k-1))) = Sum_{n>=1} a(n)*x^n/n. - _Ilya Gutkovskiy_, Jul 30 2018 %F A001227 G.f.: (psi_{q^2}(1/2) + log(1-q^2))/log(q), where psi_q(z) is the q-digamma function. - _Michael Somos_, Jun 01 2019 %F A001227 a(n) = A003056(n) - A238005(n). - _Omar E. Pol_, Sep 12 2021 %F A001227 Sum_{k=1..n} a(k) ~ n*log(n)/2 + (gamma + log(2)/2 - 1/2)*n, where gamma is Euler's constant (A001620). - _Amiram Eldar_, Nov 27 2022 %F A001227 Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A000005(k) = log(2) (A002162). - _Amiram Eldar_, Mar 01 2023 %F A001227 a(n) = Sum_{i=1..n} (-1)^(i+1)*A135539(n,i). - _Ridouane Oudra_, Apr 13 2023 %e A001227 G.f. = 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 + ... %e A001227 From _Omar E. Pol_, Nov 30 2020: (Start) %e A001227 For n = 9 there are three odd divisors of 9; they are [1, 3, 9]. On the other hand there are three partitions of 9 into consecutive parts: they are [9], [5, 4] and [4, 3, 2], so a(9) = 3. %e A001227 Illustration of initial terms: %e A001227 Diagram %e A001227 n a(n) _ %e A001227 1 1 _|1| %e A001227 2 1 _|1 _| %e A001227 3 2 _|1 |1| %e A001227 4 1 _|1 _| | %e A001227 5 2 _|1 |1 _| %e A001227 6 2 _|1 _| |1| %e A001227 7 2 _|1 |1 | | %e A001227 8 1 _|1 _| _| | %e A001227 9 3 _|1 |1 |1 _| %e A001227 10 2 _|1 _| | |1| %e A001227 11 2 _|1 |1 _| | | %e A001227 12 2 |1 | |1 | | %e A001227 ... %e A001227 a(n) is the number of horizontal line segments in the n-th level of the diagram. For more information see A286001. (End) %p A001227 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: %p A001227 A001227 := proc(n) local a,d; %p A001227 a := 1 ; %p A001227 for d in ifactors(n)[2] do %p A001227 if op(1,d) > 2 then %p A001227 a := a*(op(2,d)+1) ; %p A001227 end if; %p A001227 end do: %p A001227 a ; %p A001227 end proc: # _R. J. Mathar_, Jun 18 2015 %t A001227 f[n_] := Block[{d = Divisors[n]}, Count[ OddQ[d], True]]; Table[ f[n], {n, 105}] (* _Robert G. Wilson v_, Aug 27 2004 *) %t A001227 Table[Total[Mod[Divisors[n], 2]],{n,105}] (* _Zak Seidov_, Apr 16 2010 *) %t A001227 f[n_] := Block[{d = DivisorSigma[0, n]}, If[ OddQ@ n, d, d - DivisorSigma[0, n/2]]]; Array[f, 105] (* _Robert G. Wilson v_ *) %t A001227 a[ n_] := Sum[ Mod[ d, 2], { d, Divisors[ n]}]; (* _Michael Somos_, May 17 2013 *) %t A001227 a[ n_] := DivisorSum[ n, Mod[ #, 2] &]; (* _Michael Somos_, May 17 2013 *) %t A001227 Count[Divisors[#],_?OddQ]&/@Range[110] (* _Harvey P. Dale_, Feb 15 2015 *) %t A001227 (* using a262045 from A262045 to compute a(n) = number of subparts in the symmetric representation of sigma(n) *) %t A001227 (* cl = current level, cs = current subparts count *) %t A001227 a001227[n_] := Module[{cs=0, cl=0, i, wL, k}, wL=a262045[n]; k=Length[wL]; For[i=1, i<=k, i++, If[wL[[i]]>cl, cs++; cl++]; If[wL[[i]]<cl, cl--]]; cs] %t A001227 a001227[105] (* sequence data *) (* _Hartmut F. W. Hoft_, Dec 16 2016 *) %t A001227 a[n_] := DivisorSigma[0, n / 2^IntegerExponent[n, 2]]; Array[a, 100] (* _Amiram Eldar_, Jun 12 2022 *) %o A001227 (PARI) {a(n) = sumdiv(n, d, d%2)}; /* _Michael Somos_, Oct 06 2007 */ %o A001227 (PARI) {a(n) = direuler( p=2, n, 1 / (1 - X) / (1 - kronecker( 4, p) * X))[n]}; /* _Michael Somos_, Oct 06 2007 */ %o A001227 (PARI) a(n)=numdiv(n>>valuation(n,2)) \\ _Charles R Greathouse IV_, Mar 16 2011 %o A001227 (PARI) a(n)=sum(k=1,round(solve(x=1,n,x*(x+1)/2-n)),(k^2-k+2*n)%(2*k)==0) \\ _Charles R Greathouse IV_, May 31 2013 %o A001227 (PARI) a(n)=sumdivmult(n,d,d%2) \\ _Charles R Greathouse IV_, Aug 29 2013 %o A001227 (Haskell) %o A001227 a001227 = sum . a247795_row %o A001227 -- _Reinhard Zumkeller_, Sep 28 2014, May 01 2012, Jul 25 2011 %o A001227 (SageMath) %o A001227 def A001227(n): return len([1 for d in divisors(n) if is_odd(d)]) %o A001227 [A001227(n) for n in (1..80)] # _Peter Luschny_, Feb 01 2012 %o A001227 (Magma) [NumberOfDivisors(n)/Valuation(2*n, 2): n in [1..100]]; // _Vincenzo Librandi_, Jun 02 2019 %o A001227 (Python) %o A001227 from functools import reduce %o A001227 from operator import mul %o A001227 from sympy import factorint %o A001227 def A001227(n): return reduce(mul,(q+1 for p, q in factorint(n).items() if p > 2),1) # _Chai Wah Wu_, Mar 08 2021 %Y A001227 Cf. A000005, A000079, A000593, A010054 (char. func.), A038547 (positions of first appearances), A050999, A051000, A051001, A051002, A051731, A054844, A069283, A069288, A109814, A115369, A118235, A118236, A125911, A136655, A183063, A183064, A237593, A247795, A272887, A273401, A279387, A286001. %Y A001227 Cf. A000203, A001620, A002162, A053866, A060831. %Y A001227 If this sequence counts gapless sets by sum (by Sylvester's enumeration), these sets are ranked by A073485 and A356956. See also A055932, A066311, A073491, A107428, A137921, A333217, A356224, A356841, A356845. %Y A001227 Dirichlet inverse is A327276. %K A001227 nonn,easy,nice,mult,core %O A001227 1,3 %A A001227 _N. J. A. Sloane_