Find all primes that can be written both as a sum of two primes and as a difference of two primes.
1. Let \( p \) be a prime number that can be written both as a sum of two primes and as a difference of two primes. Therefore, we can write:
   \[
   p = q + r \quad \text{and} \quad p = s - t
   \]
   where \( q \) and \( r \) are primes, and \( s \) and \( t \) are primes with \( r < q \) and \( t < s \).

2. Since \( p \) is a prime number greater than 2 (as 2 cannot be written as a difference of two primes), we consider the cases where \( q \) and \( r \) are both greater than 3. If both \( q \) and \( r \) are greater than 3, then \( p \) would be even and greater than 2, which would make \( p \) composite. Therefore, one of \( q \) or \( r \) must be 2.

3. Without loss of generality, let \( r = 2 \). Then:
   \[
   p = q + 2
   \]
   where \( q \) is a prime number.

4. Similarly, from \( p = s - t \), since \( p > 2 \), we must have \( t = 2 \). Therefore:
   \[
   p = s - 2
   \]
   where \( s \) is a prime number.

5. Combining these results, we have:
   \[
   p = q + 2 \quad \text{and} \quad p = s - 2
   \]
   which implies:
   \[
   q + 2 = s - 2 \implies s = q + 4
   \]

6. Therefore, \( p \), \( p - 2 \), and \( p + 2 \) must all be primes. Consider these numbers modulo 3:
   - If \( p \equiv 0 \pmod{3} \), then \( p \) must be 3, but 3 cannot be written as a difference of two primes.
   - If \( p \equiv 1 \pmod{3} \), then \( p - 2 \equiv -1 \equiv 2 \pmod{3} \) and \( p + 2 \equiv 3 \equiv 0 \pmod{3} \). Since \( p + 2 \) is divisible by 3, it must be 3, but \( p + 2 > 3 \).
   - If \( p \equiv 2 \pmod{3} \), then \( p - 2 \equiv 0 \pmod{3} \) and \( p - 2 \) must be 3. Therefore, \( p - 2 = 3 \implies p = 5 \).

7. Verify that \( p = 5 \) satisfies the conditions:
   - \( 5 = 3 + 2 \) (sum of two primes)
   - \( 5 = 7 - 2 \) (difference of two primes)

Thus, \( p = 5 \) is the only prime that can be written both as a sum of two primes and as a difference of two primes.

The final answer is \( \boxed{5} \)