# The only prime that can be written this way

As I was reading my number theory textbook I came across the following question after reading about the idea of infinitely many primes:

There is only one prime number that can be written both as the sum of two primes and the difference of two primes. Find that number and prove that it is the only one.

I’ve been thinking it could be 5? Since $$2+3=5$$ and $$7-2=5$$. However, I’m not sure.

As far as proving that number is the only one: should I reference Goldbach’s Conjecture or something along those lines? Any hints would be greatly appreciated.

• Hint: if $p$ is an odd prime of the form you want, show that both $p+2$ and $p-2$ must be prime. – lulu May 2 '20 at 19:44
• Why aren't you sure? – MathematicalPhysicist May 2 '20 at 19:45
• @MathematicalPhysicist well I was thinking since you can also say $5-3=2$ and $7-5=2$ right? – Taylor Rendon May 2 '20 at 19:46
• But they are two differences and not a difference and a sum. – MathematicalPhysicist May 2 '20 at 19:48
• Whoops! You’re right. I’ve been staring at this for too long. Thank you! @MathematicalPhysicist – Taylor Rendon May 2 '20 at 19:51

Let $$x$$ be a prime number which can be written as the sum and difference of primes. $$x = a+b$$, $$x = c-d$$ for primes $$a,b,c,d$$. Note that if $$d$$ is not $$2$$, then $$c-d$$ is even, which implies that $$x=2$$, but $$2$$ cannot be written as the sum of two primes. Therefore, we can conclude that $$d=2$$.
Similarly, if neither of $$a,b$$ are equal to $$2$$, then $$a+b$$ is even, which is impossible by the above argument, so take without loss of generality that $$a=2$$. Therefore $$x+2$$ and $$x-2$$ are primes, as well as $$x$$. The above arguments imply that $$x$$ should be odd, so modulo $$6$$, these numbers are $$1,3,5$$ in some order. However, numbers which are $$3$$ mod $$6$$ are divisible by $$3$$, so to be prime, must in fact be $$3$$. From there, we can easily conclude that our three numbers $$x-2,x,x+2$$ are $$3,5,7$$, from which your conclusion follows.
• A simple computer search confirms that only $5$, within in the first $10000$ primes, has that property. – David G. Stork May 2 '20 at 19:53