[Math] Find all prime numbers $p$ such that $p \mid 2^p + 1$

number theory

I know that they somehow look like Mersenne primes $2^p-1$ but in this case we have $2^p+1$.

Here is my attempt.

If $p \mid 2^p+1$ then $ \exists k \in Z$ such that $pk = 2^p+1$ or that $2^p \equiv -1 \pmod p$.
For example, $2$ is a prime but it doesn't divide $2^2 + 1 = 5$. However, $3$ is a prime that divides $2^3 + 1 = 9$

Now how can I generate all numbers that satisfy this ?

Best Answer

Using Fermat's little theorem $p$ divides $2^p-2$ and if we add your hypothesis $p|2^p+1$ then $p$ divides $3=(2^p+1)-(2^p-2)$

Related Question