TITLE: Primes of the form $2^p-p$ or $2^p+p$ with $p$ prime
QUESTION [5 upvotes]: I have to find some prime numbers of the form $2^p-p$ or $2^p+p$ with $p$ a prime number. The question is how many of these prime numbers there are? 
I have no clue of how this can be done. Thanks and please excuse my English.

REPLY [2 votes]: Let  $p_1 = 2^p + p$ and $p_2 = 2^p - p$. Trivially, $p = 3$ is a solution. Let $p > 3$. Then either $p$ is of the form $6k+1$ or it is of the form $6k+5$.
Case 1: $p$ is of the form $6k+1$. In this case, $p_1 \equiv 2^{6k+1} + 6k + 1 \equiv 64^k*2 + 1 \equiv 4^k*2 + 1 \equiv 4*2 + 1 \equiv 3(\mod 6)$ hence $p_1$ cannot be a prime.
Case 2: $p$ is of the form $6k+5$. In this case, $p_2 \equiv 2^{6k+5} - 6k - 5 \equiv 3 (\mod 6)$ hence $p_2$ cannot be a prime.
Thus the only solution is when $p = 3$.