Testing the prime condition in the Euclid construction (source code)

= Testing the prime condition in the Euclid construction

The <prime> exponents $2,3,5,7,13$ give <Mersenne primes> and therefore <perfect numbers>. But $p=11$ gives $2^{11}-1=2047=23\cdot89$. The resulting candidate $N=2^{10}\cdot2047=2096128$ has
$$
\sigma(N)=(1+2+\cdots+2^{10})(1+23)(1+89)=2047\cdot24\cdot90=4421520,
$$
so $s(N)=2325392>N$. It is an <abundant number>, not a <perfect number>. Checking only that the exponent is <prime> would miss this obstruction.

\Image[/euclid-perfect-number-prime-condition.png]
{title=A prime exponent gives a candidate; the Mersenne factor must also be prime}
{description=Original exact computations for $p=2,3,5,7,11,13$. The upper table lists $M_p=2^p-1$ and the constructed candidate $N$. The lower bars show $s(N)/N$; equality at one identifies <perfect numbers>. The composite factor at $p=11$ makes the candidate <abundant>.}