Integers with Prime Values of Divisor Sum

Theorem
The sequence of integer whose divisor sum is prime begins:

Proof
Apart from $2$, all primes are odd.

From Divisor Sum is Odd iff Argument is Square or Twice Square, for $\map {\sigma_1} n$ to be odd it needs to be of the form $m^2$ or $2 m^2$.

Suppose $n$ has two coprime divisors $p$ and $q$, each to power $k_p$ and $k_q$ respectively.

Then $\map {\sigma_1} n$ will have $\map {\sigma_1} {p^{k_p} }$ and $\map {\sigma_1} {q^{k_q} }$ as divisors.

Hence $\map {\sigma_1} n$ will not be prime.

So for $\map {\sigma_1} n$ to be prime, $n$ can have only one prime factor.

This gives possible values for $n$ as:
 * powers of $2$, either odd or even

or:
 * even powers of a prime number.

These can be investigated in turn, using Divisor Sum of Power of Prime:


 * $\map {\sigma_1} {p^k} = \dfrac {p^{k + 1} - 1} {p - 1}$

Note that as $\map {\sigma_1} {2^k} = \dfrac {2^{k + 1} - 1} {2 - 1} = 2^{k + 1} - 1$ it is necessary for powers of $2$ merely to report the appropriate Mersenne prime.

Hence when $k + 1$ is not prime, $\map {\sigma_1} {2^k}$ will not be prime and there is no need to test it.

Thus we test all $n$ such that:
 * $n = p^{2 k}$ for prime $p$
 * $n = 2^k$ where $k + 1$ is prime

and so:

Hence the sequence as given.