# Perfect Numbers

A positive natural N is described as perfect (or a perfect number) precisely if it is equal to the sum of its proper divisors. Whenever N = n.m, each of n and m is described as a divisor of N; from N = 1.N we always obtain N as a divisor of itself; all divisors of N other than N itself are described as proper divisors. There is one general family of perfect numbers; none others are known, but nor is it known that there are no others.

There are various naturals i for which Q = power(i, 2) −1 is a prime; if we multiply such a prime by power(i−1, 2) we get a perfect number. Its divisors are powers of 2 up to and including power(i−1, 2) and products of Q with powers of 2 up to but not including this last one. Since the powers of two sum to Q, the sum of these factors is just Q times: one (from the sum of powers of two) plus the sum of powers of two, excluding the last – and the added one makes this multiplier of Q come out exactly at that excluded last power of two. For example 3×2 = 6, 7×4 = 28, 31×16 = 496, 127×64 = 8128 and 8191×4096 = 33550336 are the first five perfect numbers. It remains unknown whether there are any perfect numbers not of this form.

## Summing factors

In studying perfect numbers, it is convenient to define a mapping S from positive naturals, with S(i) being the sum of all proper divisors of i. There are no proper divisors of 1, and the sum of an empty list is zero, so S(1) = 0. For every prime p, S(p) = 1; indeed, for every natural i, S(power(i, p)) = (power(i, p) −1) / (p −1); in the special case p = 2 the numerator is just 1 and the output is simply one less than the input.

Given a factorisation of some positive natural N, we can express S(N) in terms of its factors and their values of S. Let p be a prime (generally, a divisor of N), with multiplicity at least n – so that N = power(n, p).q for some natural q (usually, one shall chose one coprime to p). Each divisor of N is then a divisor of q times some power of p, which lets us re-organize the sum S(N): for i in n, every divisor of q (including q itself) appears scaled by power(i, p); and all proper divisors of q also appear scaled by power(n, p). We thus obtain:

S(power(n, p).q)
= S(q).sum(: power(i, p) ←i :1+n) +q.sum(: power(i, p) ←i :n)
= S(q).power(n, p) +(S(q) +q).(power(n, p) −1) / (p −1)
= (S(q).(power(1+n, p) −1) +q.(power(n, p) −1)) / (p −1)
= S(q) +(S(q).p +q).(power(n, p) −1) / (p −1)

(Each of the last three forms is derived directly from the first, rather than via the intervening ones.) For N to be perfect, we require N = S(N). In particular, this is a multiple of power(n, p); and the second form above equates S(N) to a sum in which one term is a multiple of power(n, p); we may, thus, infer that the other term is also a multiple of power(n, p). However, we can be entirely sure that (power(n, p) −1) / (p −1) is not a multiple of p, let alone of power(n, p); thus q +S(q) must be a multiple of power(n, p).

For our family of known perfect numbers, with p = 2 and q = power(1+n, 2) −1, with q prime so S(q) = 1 and q+S(q) is simply twice power(n, p), our denominator p−1 is just 1, so we get

S(N = power(n, 2).q)
= S(q).(power(1+n, 2) −1) +q.(power(n, 2) −1)
= 1.q +N −q
= N

so power(i−1, 2).(power(i, 2) −1) is indeed perfect whenever its second factor is prime.

We can infer, from the second form of S reduced around a prime, that a product N = q.power(n, p) has S(N) > N whenever p is prime, n>0 and S(q) > q – since the term S(q).power(n, p) is then ≥ N in this case, and the term added to it is positive. In particular, any perfect number satisfies q's constraint, as does any N resulting from an application of this result – so we can infer that no proper multiple of a perfect number can be perfect.  Written by Eddy.