The Euclid–Euler theorem is a theorem in mathematics that relates perfect numbers to Mersenne primes. It states that every even perfect number can be represented by the form 2n − 1(2n − 1), where 2n − 1 is a prime number. The prime numbers of this form are known as Mersenne primes, and require n itself to be prime.
An even positive integer is a perfect number, that is, equals the sum of its proper divisors, if and only if it has the form 2p−1Mp where Mp is a Mersenne prime (i.e. a prime number of the form Mp = 2p − 1).
Euclid proved that 2p − 1(2p − 1) is an even perfect number whenever 2p − 1 is prime (Euclid, Prop. IX.36). This is the final result on number theory in Euclid's Elements; the later books in the Elements instead concern irrational numbers, solid geometry, and the golden ratio. Euclid expresses the result by stating that if a finite geometric series beginning at 1 with ratio 2 has a prime sum P, then this sum multiplied by the last term T in the series is perfect. Expressed in these terms, the sum P of the finite series is the Mersenne prime 2p − 1 and the last term T in the series is the power of two 2p − 1. Euclid proves that PT is perfect by observing that the geometric series with ratio 2 starting at P, with the same number of terms, is proportional to the original series; therefore, since the original series sums to P = 2T − 1, the second series sums to P(2T − 1) = 2PT − P, and both series together add to 2PT, two times the supposed perfect number. However, these two series are disjoint from each other and (by the primality of P) exhaust all the divisors of PT, so PT has divisors that sum to 2PT, showing that it is perfect.