Perfect numbers were given their name by the ancient Greek mathematicians,
who mixed number theory with mysticism. A **perfect number** is a number
that is equal to the sum of all of its (positive) divisors, excluding itself.

6 is the first perfect number because 6 = 1 + 2 + 3.

28 is also perfect, because 28 = 1 + 2 + 4 + 7 + 14.

The third perfect number is 496, and the fourth is 8128. All of these were
found by the ancient Greeks. The fifth perfect number, 33,550,336,
is much larger than the first four.
It was first mentioned in a fifteenth-century manuscript.

Numbers that are not perfect are classified as either **abundant** or **deficient**. *Abundant numbers* are numbers whose sum of proper divisors is greater than the number itself. The smallest such number is 12, whose divisors sum to 1 + 2 + 3 + 4 + 6 = 16. *Deficient numbers* are numbers whose sum of proper divisors is less than the number itself.

The Greek mathematician
Euclid discovered a pattern that
allowed him to show that 496 and 8128 are perfect numbers.
He proved (Elements, book IX, proposition 36)
that, if 2^{ k} − 1 (where `k` is a positive integer)
is prime,
then 2^{ k-1} × (2^{ k} − 1) is perfect.
Primes of the form 2^{ k} − 1 are called
Mersenne primes.
For example, 8128 = 2^{ 6} × (2^{ 7} − 1).
All of the perfect numbers generated by this method are even.
In the 18th century, Leonhard Euler proved that all even perfect
numbers are of Euclid's form.

On the other hand, odd perfect numbers are a mystery to mathematicians.
No-one has found an odd perfect number, but no-one has been able to
prove that all perfect numbers are even.
There are many conditions that an odd perfect number must satisfy.
Euler proved that an odd perfect number must be of the form
p^{ a} × q^{ b} × r^{ c} × ...,
where p, q, r, etc. are of the form 4n + 1,
a is of the form 4n + 1, and b, c, etc. are all even.
More recently, several other conditions were discovered.
An odd perfect number must be a perfect square multiplied by an odd power of a
single prime. It must have at least
eight distinct prime factors. If 3 is not one of those factors, at least
eleven distinct factors are required. It must also be divisible by a
prime power greater than 10^{ 20}.
The greatest prime factor
must be greater than 300,000 and the second largest must be greater
than 1000. Any odd perfect less than 10^{ 9118} is divisible
by the sixth power of some prime. In Richard Guy's Unsolved Problems in Number Theory, he states that the lower bound for an odd
perfect number was (as of 1991) above 10^{ 300}, although
he writes that there is some scepticism about the later proofs, possibly due
to the sloppiness of the proofs. It is possible, though,
that some number may just satisfy all of the conditions.

Currently, about 47 perfect numbers are known, although the Great Internet Mersenne Prime Search discovers new ones from time to time. Here are the first seven perfect numbers:

- 6
- 28
- 496
- 8,128
- 33,550,336
- 8,589,869,056
- 137,438,691,328

You may also be interested in reading about amicable numbers.