Perfect numbers are positive integers such that
|
(1)
|
where
is the restricted divisor function
(i.e., the sum of proper divisors
of
), or equivalently
|
(2)
|
where
is the divisor function (i.e., the sum
of divisors of
including
itself). For example, the first few perfect numbers are 6,
28, 496, 8128, ... (OEIS A000396), since
|
(3)
| |||
|
(4)
| |||
|
(5)
|
etc.
The th
even perfect number is implemented in the Wolfram
Language as PerfectNumber[n,
"Even"] and checking to see if
is a perfect number as PerfectNumberQ[k].
The first few perfect numbers are summarized in the following table together with their
corresponding Mersenne prime exponents
. These are the primes
for which
is also prime. For example, 11 is omitted because
is composite.
| 1 | 2 | 6 |
| 2 | 3 | 28 |
| 3 | 5 | 496 |
| 4 | 7 | 8128 |
| 5 | 13 | 33550336 |
| 6 | 17 | 8589869056 |
| 7 | 19 | 137438691328 |
| 8 | 31 | 2305843008139952128 |
Perfect numbers were deemed to have important numerological properties by the ancients, and were extensively studied by the Greeks, including Euclid.
Perfect numbers are also intimately connected with a class of numbers known as Mersenne primes, which are prime
numbers of the form .
This can be demonstrated by considering a perfect number
of the form
where
is an odd prime and
is an integer. By definition
of a perfect number
,
|
(6)
|
Now note that there are special forms for the divisor function
|
(7)
|
for
a prime, and
|
(8)
|
for
with a nonnegative integer
. Combining these with the additional identity
|
(9)
|
where
is the prime factorization of
, gives
|
(10)
| |||
But ,
so
|
(11)
|
Solving for
then gives
|
(12)
|
Therefore, if
is to be a perfect number,
must be of the form
. Defining
as a prime number of the
form
,
it then follows that
|
(13)
|
is a perfect number, as stated in Proposition IX.36 of Euclid's Elements (Dunham 1990; Dickson 2005, p. 3).
While many of Euclid's successors implicitly assumed that all perfect numbers were of the form (13) (Dickson 2005, pp. 3-33), the precise
statement that all even perfect numbers are of this
form was first considered in a 1638 letter from Descartes to Mersenne (Dickson 2005,
p. 12). Proof or disproof that Euclid's construction gives all possible even
perfect numbers was proposed to Fermat in a 1658 letter from Frans van Schooten (Dickson
2005, p. 14). In a posthumous 1849 paper, Euler provided the first proof of
the converse: every even perfect number has Euclid's
form ,
with
prime (Dickson 2005, p. 19). Together, the two
directions are known as the Euclid-Euler theorem.
It is not known if any odd perfect numbers exist. Ochem and Rao (2012) proved that any such number must exceed . Ochem's project page reports a subsequent computation
extending the bound to
,
as checked in Oct. 2026 (Ochem 2026).
Barlow (1811, p. 43), after listing the eighth perfect number, predicted that it was "the greatest that ever will be discovered," since such numbers were considered curious rather than useful and nobody would attempt to find a larger one. The prediction was overturned by later searches.
All even perfect numbers are of the form
|
(14)
|
where
is a triangular number
|
(15)
|
such that
(Eaton 1995, 1996). In addition, all even perfect
numbers are hexagonal numbers, so it follows
that even perfect numbers are always the sum
of consecutive positive
integers starting at 1, for example,
|
(16)
| |||
|
(17)
| |||
|
(18)
|
(Singh 1997), where 3, 7, 31, ... (OEIS A000668) are simply the Mersenne primes. In addition, every
even perfect number is of the form
and can be generated using the identity
|
(19)
|
for odd primes such that
is a Mersenne prime.
It is known that all even perfect numbers (except 6) end in 16, 28, 36, 56, 76, or 96 (Lucas 1891) and have digital root 1. In particular, the last digits of the first few perfect numbers are 6, 8, 6, 8, 6, 6, 8, 8, 6, 6, 8, 8, 6, 8, 8, ... (OEIS A094540). The ordering uncertainty between the 38th and 41st Mersenne primes, and hence the corresponding even perfect numbers, was resolved by Dec. 1, 2011 (GIMPS 2026).
The sum of reciprocals of all the divisors of a perfect number is 2. For a perfect
number ,
|
(20)
|
Replacing each divisor by
permutes the divisors, so
|
(21)
|
and division by gives
|
(22)
|
If ,
is said to be an abundant
number. If
,
is said to be a deficient
number. And if
for a positive integer
,
is said to be a multiperfect
number of order
.
The only even perfect number of the form is 28 (Makowski 1962).
Ruiz has shown that a positive integer is a perfect number iff
|
(23)
|
where
is the floor function.