# Finding primes from 6 integers closest to two twin primes multiplied together.

We are given the twin primes $$a$$ and $$b$$, where $$a > 5$$. We are told that only one of the following: $$ab-3, ab-2, ab-1, ab+1, ab+2, ab+3$$ will sometimes generate a prime but not always.

It's clear straight away that ab-3, ab+3, ab-1 and ab+1 can never be prime since ab when multiplied together is odd and therefore adding an odd to odd gives you an even number so therefore never prime.

That leaves only $$ab-2$$ and $$ab+2$$ that could possibly generate a prime number. Through some calculations I found it can only be $$ab+2$$ but I can't seem to find a proof of why, I'm guessing it's something to do with the fact that $$ab-2$$ but be a multiple of 3 or 5 but I'm not 100% sure.

Any help would be greatly appreciated and if anything is unclear please let me know, cheers.

If $$a\equiv 1\pmod{3}$$ then $$b\equiv a+2\equiv 0\pmod{3}$$, is impossible as $$b>5$$. So, it must be that $$a\equiv 2\pmod{3}$$ and so $$b\equiv 1\pmod{3}$$. So, $$ab-2\equiv 1\cdot 2-2\equiv 0\pmod{3}$$.

Let's say $$3. We note that $$a\equiv 1 \pmod 3\implies b=a+2\equiv 0 \pmod 3$$ so we must have $$a\equiv 2\pmod 3$$ and $$b\equiv 1 \pmod 3$$

Thus $$ab\equiv 2 \pmod 3$$ whence, $$ab-2\equiv 0 \pmod 3$$

Thus $$ab-2$$ can't be prime if it exceeds $$3$$.

• Just wondering on the second like you have put $$a\equiv 1 (mod 3)$$ but then on the next line you have said $$a\equiv 2 (mod 3)$$ can this be the case? – user637295 Feb 4 '19 at 18:28
• @LittleRichard any prime $>3$ must either be $\equiv 1\pmod 3$ or $\equiv 2 \pmod 3$. In my first line, I rule out the possibility of $a\equiv 1 \pmod 3$ so then we must have $a\equiv 2 \pmod 3$. – lulu Feb 4 '19 at 18:37
• Oh yes of course, my mistake, thanks – user637295 Feb 4 '19 at 18:38

Similar thinking as in the previous answers. For all twin primes $$(a,b),\ a>5$$ it is the case that $$a=6k-1,\ b=6k+1$$. Thus $$ab=36k^2-1$$. Plainly $$3\mid (36k^2-3)=ab-2$$. So $$ab+2$$ is the only remaining option, as you found empirically.