The divisor function
for
a positive integer is defined as the sum
of the
th
powers of the (positive
integer) divisors of
,
|
(1)
|
It is implemented in the Wolfram Language as DivisorSigma[k, n].
The notations
(Hardy and Wright 1979, p. 239),
(Ore 1988, p. 86), and
(Burton 1989, p. 128) are sometimes used for
, which gives the number
of divisors of
. Rather surprisingly, the number of distinct irreducible
polynomials in the polynomial factorization
of
over the rational numbers, with
and
treated as indeterminates,
is also given by
.
The values of
can be found as the inverse Möbius transform
of 1, 1, 1, ... (Sloane and Plouffe 1995, p. 22). Heath-Brown (1984) proved
that
infinitely often. The numbers having the incrementally largest number of divisors
are called highly composite numbers. The
function
satisfies the identities
|
(2)
| |||
|
(3)
|
where the
are distinct primes and
is the prime
factorization of a number
.
The divisor function
is odd iff
is a square number.
The function that gives the sum
of the divisors of
is commonly written without the subscript,
i.e.,
.
Li (2026) considered the number of ordered pairs
|
(4)
|
where
and
are positive integers. Guy (1994) records the
question of whether
for some constant
. This is problem 1061
in the Erdős problems collection (Bloom 2026).
Li (2026) instead reported
|
(5)
|
for every fixed .
Large language models, primarily ChatGPT, contributed to technical development of
the proof, and Aristotle produced an accompanying Lean
formalization under the author's direction. As of Sep. 21, 2026, independent
specialist review had not been reported, and VibeMathed had not independently compiled
the formalization (VibeMathed 2026).
As an illustrative example of computing , consider the number 140, which has divisors
, 2, 4, 5, 7, 10, 14, 20, 28, 35,
70, and 140, for a total of
divisors in all. Therefore,
|
(6)
| |||
|
(7)
| |||
|
(8)
| |||
|
(9)
|
The following table summarizes the first few values of for small
and
, 2, ....
| OEIS | ||
| 0 | A000005 | 1, 2, 2, 3, 2, 4, 2, 4, 3, 4, 2, 6, ... |
| 1 | A000203 | 1, 3, 4, 7, 6, 12, 8, 15, 13, 18, ... |
| 2 | A001157 | 1, 5, 10, 21, 26, 50, 50, 85, 91, 130, ... |
| 3 | A001158 | 1, 9, 28, 73, 126, 252, 344, 585, 757, 1134, ... |
The sum of the divisors of excluding
itself (i.e., the proper divisors
of
)
is called the restricted divisor function
and is denoted
.
The first few values are 0, 1, 1, 3, 1, 6, 1, 7, 4, 8, 1, 16, ... (OEIS A001065).
The sum of divisors can be found as follows. Let
with
and
. For any divisor
of
,
, where
is a divisor of
and
is a divisor of
. The divisors of
are 1,
,
, ..., and
. The divisors of
are 1,
,
, ...,
. The sums of the divisors
are then
|
(10)
| |||
|
(11)
|
For a given ,
|
(12)
|
Summing over all ,
|
(13)
|
so .
Splitting
and
into prime factors,
|
(14)
|
For a prime power , the divisors are
1,
,
, ...,
, so
|
(15)
|
For ,
therefore,
|
(16)
|
(Berndt 1985).
For the special case of a prime, (16)
simplifies to
|
(17)
|
Similarly, for
a power of two, (16) simplifies to
|
(18)
|
The identities (14) and (16) can be generalized to
|
(19)
| |||
when
for all
.
Sums involving the divisor function are given by
|
(20)
|
for ,
|
(21)
|
for ,
and more generally,
|
(22)
|
for
and
(Hardy and Wright 1979, p. 250).
A generating function for is given by the Lambert
series
|
(23)
| |||
where
is the order-zero q-polygamma function
and
.
The
function has the series expansion
|
(24)
|
(Hardy 1999). Ramanujan gave the beautiful formula
|
(25)
|
where
is the zeta function and
(Wilson 1923), which was
used by Ingham in a proof of the prime
number theorem (Hardy 1999, pp. 59-60). This gives the special case
|
(26)
|
(Hardy 1999, p. 59).
Gronwall's theorem states that
|
(27)
|
where
is the Euler-Mascheroni constant (Hardy
and Wright 1979, p. 266; Robin 1984). Robin (1984, Theorem 2) proved the explicit
inequality
|
(28)
|
for ,
with equality at
,
giving
|
(29)
| |||
The Riemann hypothesis is equivalent to the statement that
|
(30)
|
for all
(Robin 1984, Theorem 1).
is a power of 2 iff
or
is a product of distinct Mersenne
primes (Sierpiński 1963, Sivaramakrishnan 1989, Kaplansky 1999). The first
few such
are 1, 3, 7, 21, 31, 93, 127, 217, 381, 651, 889, 2667, ... (OEIS A046528),
and the powers of 2 these correspond to are 0, 2, 3, 5,
5, 7, 7, 8, 9, 10, 10, 12, 12, 13, 14, ... (OEIS A048947).
Curious identities derived using modular form theory are given by
|
(31)
|
|
(32)
|
(Apostol 1997, p. 140), together with
|
(33)
|
|
(34)
|
|
(35)
|
(M. Trott, pers. comm.).
The divisor function
(and, in fact,
for
)
is odd iff
is a square number or twice
a square number. The divisor function
satisfies the congruence
|
(36)
|
for all primes and no composite numbers with the exception of 4, 6, and 22 (Subbarao 1974).
The number of divisors is prime whenever
itself is prime
(Honsberger 1991). Factorizations of
for prime
are given by Sorli.
Dirichlet (1838) showed that the average number of divisors of all numbers from 1 to is asymptotic to
|
(37)
|
(Conway and Guy 1996; Hardy 1999, p. 55; Havil 2003, pp. 112-113), as illustrated above, where the thin solid curve plots the actual values and the thick dashed curve
plots the asymptotic function.
This is related to the Dirichlet divisor
problem, which seeks to find the "best" coefficient in
|
(38)
|
(Hardy and Wright 1979, p. 264).
The summatory functions for with
are
|
(39)
|
For ,
|
(40)
|
(Hardy and Wright 1979, p. 266).
The divisor function can also be generalized to Gaussian integers. The definition requires some care since each divisor
has four multiples by the units ,
,
, and
. The Wolfram Language
function Divisors[z]
chooses the unique multiple
satisfying
and
from each group of four. Reapplying this first-quadrant convention after multiplication
does not give a multiplicative function.
By contrast, Spira (1961) defines the sum of divisors of a complex number by factoring
into a product of powers
of distinct Gaussian primes,
|
(41)
|
where
is a unit and each
lies in the first quadrant
of the complex plane, and then writing
|
(42)
|
This makes
a multiplicative function and also gives
.
This extension is implemented in the Wolfram
Language as DivisorSigma[1,
z, GaussianIntegers -> True].
For example, let ,
and let
denote the list returned by Divisors[q].
Direct computation gives
|
(43)
| |||
|
(44)
|
Thus
satisfies the first identity, but is not a perfect
Gaussian integer in Spira's multiplicative sense (Sanchez Solovieva 2026).
The following table gives for small nonnegative values of
and
.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | |
| 1 | 1 | ||||||
| 2 | |||||||
| 3 | 4 | ||||||
| 4 | |||||||
| 5 | |||||||
| 6 |
The number of distinct prime factors is computed in the Wolfram Language using PrimeNu.