# Is the sum of two distinct primes an injective function on integers?

Is the sum of two unique primes always unique? I.e is it an injective function on integers? For example, $89 + 2 = 91$ and there's no other sum of two different primes that's equal to $91$.

It's been a long time since I did a proper proof but I checked it programmatically for the first $10^4$ primes and it seems to hold true. How can I prove that though?

PS: This was true by definition if it was multiplication, but I don't see the connection from the definition to addition.

• "and there's no other sum of two different primes that's equal to 91." Well, 2 is the only even prime and 91 is an odd number so... – fleablood May 3 '18 at 22:09
• So... what? Is there a proof for this statement if we add that the sum must be odd or a prime? @fleablood – shinzou May 3 '18 at 22:16
• Well...yeah... For integers if $a + b$ is odd then one of $a$ or $b$ must be even.... – fleablood May 3 '18 at 22:22
• A natural follow-up would be "are there infinitely many integers that can be written in at least two ways as the sum of two distinct primes ?" – Gabriel Romon May 4 '18 at 6:55
• Also look at something like A117929. Note that there is a link, T. D. Noe, Table of n, a(n) for n = 1..10000. As soon as $n$ becomes large, you see the pattern that when $n$ as even, there are many ways to write it as a sum of two distinct primes. When $n$ is odd, there is either no ways, or a single way (when $n$ is two greater than an odd prime). Addition: No prove is known that the pattern for even $n$ does not have exceptions (Goldbach's conjecture). – Jeppe Stig Nielsen May 4 '18 at 9:12

On the back of an envelope, so to speak, I get

\begin{array}{|r|r|r|r|r|r|r|r|r} & 3 & 5 & 7 & 11 & 13 & 17 & 19 & 23 & 29 \\ \hline 2 & 5 & 7 & 9 & 13 & 15 & 19 & 21 & 25 & 31 \\ 3 & & 8 & 10 & 14 & 16 & 20 & 22 & 26 & 32 \\ 5 & & & 12 & 16 & 18 & 22 & 24 & 28 & 34 \\ 7 & & & & 18 & 20 & 24 & 26 & 30 & 36 \\ 11 & & & & & 24 & 28 & 30 & 34 & 40 \\ 13 & & & & & & 30 & 32 & 36 & 42 \\ 17 & & & & & & & 36 & 40 & 46 \\ 19 & & & & & & & & 42 & 48 \\ 23 & & & & & & & & & 52 \\ \end{array}

So, the odd numbers seem to be unique. By contrast, the even numbers show a lot of repetition: 16 appears twice in the table above, and so do 18, 20 and 22. And 24 appears thrice, as does 30. With just one more column, 36 would appear four times.

Before giving a proper proof of the apparent uniqueness of the even numbers in the table above, we need to agree on our definitions.

If $n$ is an odd number and there exist distinct positive primes $p$ and $q$ such that $p + q = n$, then that pair of primes is the only pair of primes with that sum. Either $p = 2$ or $q = 2$.

Um... you know, as I write that, a formal proof feels like overkill to me.

• And look at the anti-diagonals. – smci May 4 '18 at 3:57

Consider $3,5$ and $11,13$.

Notice $3+13=5+11$

• all you need to do is find two primes $p$ and $q$ such that $p+a$ and $q+a$ are both primes (oh and $p+a\neq q$ ) . – Yorch May 3 '18 at 21:51
• How embarrassing. – shinzou May 3 '18 at 21:51
• it happens, what was the problem with the code? – Yorch May 3 '18 at 21:54
• I made a false assumption that the sum must also be prime... It's late here. – shinzou May 3 '18 at 21:58
• oh, in that case its easy to prove its true because $2$ is the only even prime. – Yorch May 3 '18 at 21:58

Huh? What!? Ever hear of the Goldbach conjecture?

Is the sum of two unique primes always unique?

No, not at all. In fact, if $n$ is an even integer greater than $38$, it's probably the sum of two distinct primes in more than one way. For example, $$40 = 37 + 3 = 29 + 11 = 23 + 17.$$

The situation is different for odd numbers, of course. If $n$ is odd, there is only one way, or no way at all, to represent it as a sum of two distinct primes. That is if $n = p + 2$, where $p$ is an odd prime. So with $91$, you observed that $89 + 2 = 91$. But there's no such expression for $87$, since $85$ is obviously not prime.

However, if you allow $-2$, then $87 = 89 + (-2)$. This neither bolsters nor undermines my faith in the Goldbach conjecture.

• Not sure the goldbach conjecture comes into play. If GC is true every even number is the sum of two primes but the conjecture says nothing about whether these sums are unique or not. (Although it's not hard to find a counter example. – fleablood May 3 '18 at 22:10
• Is there a proof for if n is odd? – shinzou May 3 '18 at 22:13
• If $n$ is odd and $n = a+b$ then one of $a$ or $b$ is even. $2$ is the only even prime so if $n = p+q$ where $p,q$ are prime and $n$ is odd, it must be that $n= p+2$. – fleablood May 3 '18 at 22:25
• Thank you, Mr. Blood. You hear that, @shinzou? – Mr. Brooks May 3 '18 at 22:28
• @fleablood I would have said "Goldbach comet" instead of "Goldbach conjecture". – Robert Soupe May 4 '18 at 2:00

Note that $3+17=7+13$. And that $7+23=13+17$.

Oh, just to be....

Let $p_1,q_2 = p_1 + 2$ be a pair of twin primes. Let $p_2,q_2 = p_2 + 2$ be another pair.

Then $p_1 + q_2 = p_2 + q_1=p_1 + p_2 + 2$.

First twin prime is $3,5$ and the second is $5,7$ so $3+7 = 5+5$.

It is conjectured that there are infinite twin primes so....

• you can prove there are infinite primes without conjectures, you just need to assure than an $a$ exists such that infinite pairs of primes $p,p+a$ exist, this was proven by yitang zhang. – Yorch May 4 '18 at 4:33
• I meant infinite suitable $p,p+a, q , q+a$ – Yorch May 4 '18 at 8:05
• No need for conjecture at all as one counterexample will do it. I was half tongue in cheek in posting this answer at all, but the idea was rather than stumble upon counter examples (very easily) we can systematically look for them. Also one answer mentioned the Goldbach conjecture as a famous probably true conjecture that obviously counters the statement (which it doesn't). Instead the twin primes conjecture, equally if not more well known, does contradict the statement. – fleablood May 4 '18 at 16:04
• i meant it is possible to prove there are infinite such pairs – Yorch May 4 '18 at 17:17
• I am. I wasn't familiar with that result. Thank you. – fleablood May 4 '18 at 19:25