A perfect number is a positive integer that is equal to the sum of all its proper divisors. The first perfect number is 6 in that 6 = 1+2+3, where 1, 2, and 3 are all of the proper divisors of 6. The next perfect number is 28 = 1 + 2 + 4 + 7 + 14. This is followed by the perfect numbers 496 and 8128.
Around 300 B.C., Euclid proved that If 2n-1 is a prime number (later 2n-1 is known as a Mersenne prime), then 2n-1(2n-1) is a perfect number. In the 18th century, Euler proved the converse (that every even perfect number has the 2n-1 form as well). So it comes to be known as the Euclid–Euler theorem which 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. For examples, the first four perfect numbers are generated by the formula 2n−1(2n − 1) as follows:
for n = 2: 21(22 − 1) = 6
for n = 3: 22(23 − 1) = 28
for n = 5: 24(25 − 1) = 496
for n = 7: 26(27 − 1) = 8128.
As of January 2016, 49 Mersenne primes are known, and therefore 49 even perfect numbers (the largest of which is 274207280 × (274207281 − 1) with 44,677,235 digits). It is not known whether there are infinitely many perfect numbers, nor whether there are infinitely many Mersenne primes.
As a side note, there are names for non-perfect numbers: if the sum of a number's proper factors are less than the number, it's a deficient number. If the sum is greater than the number, it's an abundant number.