A000005 d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
1, 2, 2, 3, 2, 4, 2, 4, 3, 4, 2, 6, 2, 4, 4, 5, 2, 6, 2, 6, 4, 4, 2, 8, 3, 4, 4, 6, 2, 8, 2, 6, 4, 4, 4, 9, 2, 4, 4, 8, 2, 8, 2, 6, 6, 4, 2, 10, 3, 6, 4, 6, 2, 8, 4, 8, 4, 4, 2, 12, 2, 4, 6, 7, 4, 8, 2, 6, 4, 8, 2, 12, 2, 4, 6, 6, 4, 8, 2, 10, 5, 4, 2, 12, 4, 4, 4, 8, 2, 12, 4, 6, 4, 4, 4, 12, 2, 6, 6, 9, 2, 8, 2, 8
Offset: 1
Examples
G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 2*x^5 + 4*x^6 + 2*x^7 + 4*x^8 + 3*x^9 + ...
References
- M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 840.
- T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 38.
- G. Chrystal, Algebra: An elementary text-book for the higher classes of secondary schools and for colleges, 6th ed, Chelsea Publishing Co., New York 1959 Part II, p. 345, Exercise XXI(16). MR0121327 (22 #12066)
- G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, Cambridge, University Press, 1940, p. 55.
- G. H. Hardy and E. M. Wright, revised by D. R. Heath-Brown and J. H. Silverman, An Introduction to the Theory of Numbers, 6th ed., Oxford Univ. Press, 2008.
- K. Knopp, Theory and Application of Infinite Series, Blackie, London, 1951, p. 451.
- D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Chap. II. (For inequalities, etc.)
- S. Ramanujan, Collected Papers, Ed. G. H. Hardy et al., Cambridge 1927; Chelsea, NY, 1962. Has many references to this sequence. - N. J. A. Sloane, Jun 02 2014
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- B. Spearman and K. S. Williams, Handbook of Estimates in the Theory of Numbers, Carleton Math. Lecture Note Series No. 14, 1975; see p. 2.1.
- James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 285.
- E. C. Titchmarsh, The Theory of Functions, Oxford, 1938, p. 160.
- Terence Tao, Poincaré's Legacies, Part I, Amer. Math. Soc., 2009, see pp. 31ff for upper bounds on d(n).
Links
- Daniel Forgues, Table of n, a(n) for n = 1..100000 (first 10000 terms from N. J. A. Sloane)
- M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy, requires Flash plugin].
- G. E. Andrews, Some debts I owe, Séminaire Lotharingien de Combinatoire, Paper B42a, Issue 42, 2000; see (7.1).
- J. Bell, Lambert series in analytic number theory
- R. Bellman and H. N. Shapiro, On a problem in additive number theory, Annals Math., 49 (1948), 333-340. [From _N. J. A. Sloane_, Mar 12 2009]
- Henry Bottomley, Illustration of initial terms
- D. M. Bressoud and M. V. Subbarao, On Uchimura's connection between partitions and the number of divisors, Can. Math. Bull. 27, 143-145 (1984). Zbl 0536.10013.
- C. K. Caldwell, The Prime Glossary, Number of divisors
- Imanuel Chen and Michael Z. Spivey, Integral Generalized Binomial Coefficients of Multiplicative Functions, Preprint 2015; Summer Research Paper 238, Univ. Puget Sound.
- Jimmy Devillet and Gergely Kiss, Characterizations of biselective operations, arXiv:1806.02073 [math.RA], 2018.
- P. Erdős and L. Mirsky, The distribution of values of the divisor function d(n), Proc. London Math. Soc. 2 (1952), pp. 257-271.
- Paul Erdős, Carl Pomerance and András Sárközy, On locally repeated values of certain arithmetic functions, III, Proc. Amer. Math. Soc. 101 (1987), 1-7.
- C. R. Fletcher, Rings of small order, Math. Gaz. vol. 64, p. 13, 1980.
- Robbert Fokkink and Jan van Neerven, Problemen/UWC (in Dutch)
- Daniele A. Gewurz and Francesca Merola, Sequences realized as Parker vectors ..., J. Integer Seqs., Vol. 6, 2003.
- D. R. Heath-Brown, The divisor function at consecutive integers, Mathematika 31 (1984), 141-149.
- Adolf Hildebrand, The divisor function at consecutive integers, Pacific J. Math. 129 (1987), 307-319.
- J. J. Holt and J. W. Jones, Counting Divisors, Discovering Number Theory, Section 1.4.
- P. A. MacMahon, Divisors of numbers and their continuations in the theory of partitions, Proc. London Math. Soc., 19 (1919), 75-113.
- M. Maia and M. Mendez, On the arithmetic product of combinatorial species, arXiv:math/0503436 [math.CO], 2005.
- R. G. Martinez, Jr., The Factor Zone, Number of Factors for 1 through 600.
- Math Forum, Divisor Counting.
- Mathematics Stack Exchange, A question on discrete Fourier Transform of some function
- K. Matthews, Factorizing n and calculating phi(n), omega(n), d(n), sigma(n) and mu(n).
- Mircea Merca, A new look on the generating function for the number of divisors, Journal of Number Theory, Volume 149, April 2015, Pages 57-69.
- Mircea Merca, Combinatorial interpretations of a recent convolution for the number of divisors of a positive integer, Journal of Number Theory, Volume 160, March 2016, Pages 60-75, corollary 2.1.
- J. L. Nicolas and G. Robin, Majorations Explicites Pour le Nombre de Diviseurs de N, Canadian Mathematical Bulletin, Volume 26, Issue 4, 01 December 1983, pp. 485-492.
- Matthew Parker, The first 25 million terms (7-Zip compressed file).
- Ed Pegg, Jr., Sequence Pictures, Math Games column, Dec 08 2003.
- Ed Pegg, Jr., Sequence Pictures, Math Games column, Dec 08 2003. [Cached copy, with permission (pdf only)]
- Omar E. Pol, Illustration of initial terms: figure 1, figure 2, figure 3, figure 4, figure 5, (2009), figure 6 (a, b, c), (2013)
- S. Ramanujan, On The Number Of Divisors Of A Number.
- H. B. Reiter, Counting Divisors.
- W. Sierpiński, Number Of Divisors And Their Sum.
- Terence Tao, Poincaré's Legacies: pages from year two of a mathematical blog, see page 59.
- E. C. Titchmarsh, On a series of Lambert type, J. London Math. Soc., 13 (1938), 248-253.
- Keisuke Uchimura, An identity for the divisor generating function arising from sorting theory, J. Combin. Theory Ser. A 31 (1981), no. 2, 131--135. MR0629588 (82k:05015)
- Wang Zheng Bing, Robert Fokkink and Wan Fokkink, A Relation Between Partitions and the Number of Divisors, Am. Math. Monthly, 102 (Apr., 1995), no. 4, 345-347.
- Eric Weisstein's World of Mathematics, Binomial Number, Dirichlet Series Generating Function, Divisor Function, and Moebius Transform.
- Wikipedia, Table of divisors.
- Wolfram Research, Divisors of first 50 numbers
- Index entries for "core" sequences
- Index entries for sequences computed from exponents in factorization of n
Crossrefs
For partial sums see A006218.
Cf. A007427 (Dirichlet Inverse), A001227, A001826, A001842, A005237, A005238, A006558, A006601, A019273, A027750, A034296, A039665, A049051, A049820, A051731, A061017, A066446, A091202, A091220, A106737, A115361, A127093, A129372, A129510, A143319, A156552, A159933, A159934, A163280, A183063, A237665, A263730.
Programs
-
GAP
List([1..150],n->Tau(n)); # Muniru A Asiru, Mar 05 2019
-
Haskell
divisors 1 = [1] divisors n = (1:filter ((==0) . rem n) [2..n `div` 2]) ++ [n] a = length . divisors -- James Spahlinger, Oct 07 2012
-
Haskell
a000005 = product . map (+ 1) . a124010_row -- Reinhard Zumkeller, Jul 12 2013
-
Julia
function tau(n) i = 2; num = 1 while i * i <= n if rem(n, i) == 0 e = 0 while rem(n, i) == 0 e += 1 n = div(n, i) end num *= e + 1 end i += 1 end return n > 1 ? num + num : num end println([tau(n) for n in 1:104]) # Peter Luschny, Sep 03 2023
-
Magma
[ NumberOfDivisors(n) : n in [1..100] ]; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
-
Maple
with(numtheory): A000005 := tau; [ seq(tau(n), n=1..100) ];
-
Mathematica
Table[DivisorSigma[0, n], {n, 100}] (* Enrique Pérez Herrero, Aug 27 2009 *) CoefficientList[Series[(Log[1 - q] + QPolyGamma[1, q])/(q Log[q]), {q, 0, 100}], q] (* Vladimir Reshetnikov, Apr 23 2013 *) a[ n_] := SeriesCoefficient[ (QPolyGamma[ 1, q] + Log[1 - q]) / Log[q], {q, 0, Abs@n}]; (* Michael Somos, Apr 25 2013 *) a[ n_] := SeriesCoefficient[ q/(1 - q)^2 QHypergeometricPFQ[ {q, q}, {q^2, q^2}, q, q^2], {q, 0, Abs@n}]; (* Michael Somos, Mar 05 2014 *) a[n_] := SeriesCoefficient[q/(1 - q) QHypergeometricPFQ[{q, q}, {q^2}, q, q], {q, 0, Abs@n}] (* Mats Granvik, Apr 15 2015 *) With[{M=500},CoefficientList[Series[(2x)/(1-x)-Sum[x^k (1-2x^k)/(1-x^k),{k,M}],{x,0,M}],x]] (* Mamuka Jibladze, Aug 31 2018 *)
-
MuPAD
numlib::tau (n)$ n=1..90 // Zerinvary Lajos, May 13 2008
-
PARI
{a(n) = if( n==0, 0, numdiv(n))}; /* Michael Somos, Apr 27 2003 */
-
PARI
{a(n) = n=abs(n); if( n<1, 0, direuler( p=2, n, 1 / (1 - X)^2)[n])}; /* Michael Somos, Apr 27 2003 */
-
PARI
{a(n)=polcoeff(sum(m=1, n+1, sumdiv(m, d, (-log(1-x^(m/d) +x*O(x^n) ))^d/d!)), n)} \\ Paul D. Hanna, Aug 21 2014
-
Python
from sympy import divisor_count for n in range(1, 20): print(divisor_count(n), end=', ') # Stefano Spezia, Nov 05 2018
-
Sage
[sigma(n, 0) for n in range(1, 105)] # Zerinvary Lajos, Jun 04 2009
Formula
If n is written as 2^z*3^y*5^x*7^w*11^v*... then a(n)=(z+1)*(y+1)*(x+1)*(w+1)*(v+1)*...
a(n) = 2 iff n is prime.
G.f.: Sum_{n >= 1} a(n) x^n = Sum_{k>0} x^k/(1-x^k). This is usually called THE Lambert series (see Knopp, Titchmarsh).
a(n) = A083888(n) + A083889(n) + A083890(n) + A083891(n) + A083892(n) + A083893(n) + A083894(n) + A083895(n) + A083896(n).
a(n) = A083910(n) + A083911(n) + A083912(n) + A083913(n) + A083914(n) + A083915(n) + A083916(n) + A083917(n) + A083918(n) + A083919(n).
Multiplicative with a(p^e) = e+1. - David W. Wilson, Aug 01 2001
a(n) <= 2 sqrt(n) [see Mitrinovich, p. 39, also A046522].
a(n) is odd iff n is a square. - Reinhard Zumkeller, Dec 29 2001
a(n) = Sum_{k=1..n} f(k, n) where f(k, n) = 1 if k divides n, 0 otherwise (Mobius transform of A000012). Equivalently, f(k, n) = (1/k)*Sum_{l=1..k} z(k, l)^n with z(k, l) the k-th roots of unity. - Ralf Stephan, Dec 25 2002
G.f.: Sum_{k>0} ((-1)^(k+1) * x^(k * (k + 1)/2) / ((1 - x^k) * Product_{i=1..k} (1 - x^i))). - Michael Somos, Apr 27 2003
a(n) = n - Sum_{k=1..n} (ceiling(n/k) - floor(n/k)). - Benoit Cloitre, May 11 2003
a(n) = A032741(n) + 1 = A062011(n)/2 = A054519(n) - A054519(n-1) = A006218(n) - A006218(n-1) = 1 + Sum_{k=1..n-1} A051950(k+1). - Ralf Stephan, Mar 26 2004
G.f.: Sum_{k>0} x^(k^2)*(1+x^k)/(1-x^k). Dirichlet g.f.: zeta(s)^2. - Michael Somos, Apr 05 2003
Sequence = M*V where M = A129372 as an infinite lower triangular matrix and V = ruler sequence A001511 as a vector: [1, 2, 1, 3, 1, 2, 1, 4, ...]. - Gary W. Adamson, Apr 15 2007
Sequence = M*V, where M = A115361 is an infinite lower triangular matrix and V = A001227, the number of odd divisors of n, is a vector: [1, 1, 2, 1, 2, 2, 2, ...]. - Gary W. Adamson, Apr 15 2007
Row sums of triangle A051731. - Gary W. Adamson, Nov 02 2007
Sum_{n>0} a(n)/(n^n) = Sum_{n>0, m>0} 1/(n*m). - Gerald McGarvey, Dec 15 2007
Logarithmic g.f.: Sum_{n>=1} a(n)/n * x^n = -log( Product_{n>=1} (1-x^n)^(1/n) ). - Joerg Arndt, May 03 2008
a(n) = Sum_{k=1..n} (floor(n/k) - floor((n-1)/k)). - Enrique Pérez Herrero, Aug 27 2009
a(s) = 2^omega(s), if s > 1 is a squarefree number (A005117) and omega(s) is: A001221. - Enrique Pérez Herrero, Sep 08 2009
For n > 1, a(n) = 2 + Sum_{k=2..n-1} floor((cos(Pi*n/k))^2). And floor((cos(Pi*n/k))^2) = floor(1/4 * e^(-(2*i*Pi*n)/k) + 1/4 * e^((2*i*Pi*n)/k) + 1/2). - Eric Desbiaux, Mar 09 2010, corrected Apr 16 2011
a(n) = 1 + Sum_{k=1..n} (floor(2^n/(2^k-1)) mod 2) for every n. - Fabio Civolani (civox(AT)tiscali.it), Mar 12 2010
From Vladimir Shevelev, May 22 2010: (Start)
(Sum_{d|n} a(d))^2 = Sum_{d|n} a(d)^3 (J. Liouville).
a(n) = sigma_0(n) = 1 + Sum_{m>=2} Sum_{r>=1} (1/m^(r+1))*Sum_{j=1..m-1} Sum_{k=0..m^(r+1)-1} e^(2*k*Pi*i*(n+(m-j)*m^r)/m^(r+1)). - A. Neves, Oct 04 2010
Sum_{n>=1} a(n)*q^n = (log(1-q) + psi_q(1)) / log(q), where psi_q(z) is the q-digamma function. - Vladimir Reshetnikov, Apr 23 2013
G.f.: Sum_{k>=1} Sum_{j>=1} x^(j*k). - Mats Granvik, Jun 15 2013
The formula above is obtained by expanding the Lambert series Sum_{k>=1} x^k/(1-x^k). - Joerg Arndt, Mar 12 2014
G.f.: Sum_{n>=1} Sum_{d|n} ( -log(1 - x^(n/d)) )^d / d!. - Paul D. Hanna, Aug 21 2014
2*Pi*a(n) = Sum_{m=1..n} Integral_{x=0..2*Pi} r^(m-n)( cos((m-n)*x)-r^m cos(n*x) )/( 1+r^(2*m)-2r^m cos(m*x) )dx, 0 < r < 1 a free parameter. This formula is obtained as the sum of the residues of the Lambert series Sum_{k>=1} x^k/(1-x^k). - Seiichi Kirikami, Oct 22 2015
G.f.: 2*x/(1-x) - Sum_{k>0} x^k*(1-2*x^k)/(1-x^k). - Mamuka Jibladze, Aug 29 2018
a(n) = Sum_{k=1..n} 1/phi(n / gcd(n, k)). - Daniel Suteu, Nov 05 2018
a(k*n) = a(n)*(f(k,n)+2)/(f(k,n)+1), where f(k,n) is the exponent of the highest power of k dividing n and k is prime. - Gary Detlefs, Feb 08 2019
a(n) = 2*log(p(n))/log(n), n > 1, where p(n)= the product of the factors of n = A007955(n). - Gary Detlefs, Feb 15 2019
a(n) = (1/n) * Sum_{k=1..n} sigma(gcd(n,k)), where sigma(n) = sum of divisors of n. - Orges Leka, May 09 2019
From Richard L. Ollerton, May 11 2021: (Start)
a(n) = (1/n)*Sum_{k=1..n} phi(gcd(n,k))*sigma(n/gcd(n,k))/phi(n/gcd(n,k)). (End)
From Ridouane Oudra, Nov 12 2021: (Start)
a(n) = Sum_{j=1..n} Sum_{k=1..j} (1/j)*cos(2*k*n*Pi/j);
a(n) = Sum_{j=1..n} Sum_{k=1..j} (1/j)*e^(2*k*n*Pi*i/j), where i^2=-1. (End)
Extensions
Incorrect formula deleted by Ridouane Oudra, Oct 28 2021
Comments