= Euclid-Euler theorem
{c}
{title2=$n\text{ even and perfect}\iff n=2^{p-1}(2^p-1),\ 2^p-1\text{ prime}$}
{wiki=Euclid–Euler_theorem}
An <even integer> $n>0$ is a <perfect number> \b[if and only if]
$$
\boxed{n=2^{p-1}(2^p-1)\quad\text{with }2^p-1\text{ prime}.}
$$
This forces $p$ to be a <prime number>, as shown under <Mersenne number>. It does not say that every <prime> exponent works, nor classify possible <odd integers>.<Perfect numbers and Mersenne primes by Keith Conrad>[Theorem 1.1, pp. 1–2: even-number equivalence and proof]{ref}
For the forward direction, put $q=2^p-1$ and use <coprimality> of $q$ and $2^{p-1}$. <Multiplicativity> of the <sum-of-divisors function> and the <finite geometric series> give
$$
\sigma(2^{p-1}q)=\sigma(2^{p-1})\sigma(q)=(2^p-1)(q+1)=q2^p=2n.
$$
The <prime number> hypothesis makes $\sigma(q)=q+1$; replacing it with a <composite number> changes this factor.
For a short converse outline, write $n=2^a m$ with $a\geq1$ and $m$ an <odd integer>. The condition $\sigma(n)=2n$ gives
$$
\sigma(m)=m+t,\qquad t=\frac{m}{2^{a+1}-1}.
$$
Here $t$ is a positive <integer> and a <proper divisor> of $m$. If $t>1$, the distinct <divisors> $1,t,m$ alone exceed the required <sum> $m+t$. Thus $t=1$ and $\sigma(m)=m+1$, forcing $m$ to be <prime> and $m=2^{a+1}-1$.
Back to article page