How can it be proven that integers of the form $n=6jk\pm j \pm k;\ j,k\in \mathbb N^*,$ are the only ones which (when multiplied by $6$) correspond to multiples of $6$ not between twin primes? How do we know that no other integers exist such that when they are multiplied by $6$ their products are also not between twin primes?


A few years ago, I asked this question hoping that someone might have some advice about tackling Diophantine equations of this sort. No such luck.

Specifically, the question has to do with finding integer solutions $n, j, k \in \mathbb N^*$ to the following equation $$ n=6jk\pm j\pm k $$

Since every pair of twin primes must have a multiple of $6$ between them, it is a simple matter to show that integers, $n$, of this form correspond to multiples of $6$ that don't flag a twin prime pair - i.e. $6n+1$ or $6n-1$ is not prime.

The reasoning is simply that whenever a multiple of $6$ is divisible by an integer one less or one greater than some other multiple of $6$, then there is a nearby multiple of $6$ which is adjacent to a multiple of that same number one less or one greater. For instance, $30$ is divisible by $5$, so neither $24$ nor $36$ can fall between twin primes since they are adjacent to $25$ and $35$ respectively. Likewise, $210$ is a multiple of $6$ which is not between twin primes since $209=11\times 19$, and this can be determined with the formula since $210=6\times 35$, $35=33+2$, and $33$ is a multiple of $11=6\times 2 -1$.

In other words, this equation acts as a sieve selecting out multiples of $6$ which definitely do not neighbor twin primes. Therefore, this line of reasoning imposes a necessary condition on any potential twin prime candidates.

Is this condition not only necessary but sufficient?

OEIS contributor Jon Perry seems to think that it is sufficient since he claims here that "6n-1 and 6n+1 are twin primes iff n is not of the form 6ab +- a +- b."

The proof of the conditional is fairly straightforward (as I have already explained), but the converse is far less obvious to me.

How can one prove that "If $n$ is not of the form $6ab\pm a \pm b$, then $6n-1$ and $6n+1$ are twin primes"?


Suppose we have $n$ that cannot be expressed in the form $6ab \pm a \pm b$ (for all $a,b \in \mathbb{N}$).

Now suppose $6n-1$ is not prime, so $6n-1=(6a'+1)(6b'-1)$ (for some $a',b' \in \mathbb{N}$) contradicting the hypothesis.

OR suppose $6n+1$ is not prime, so $6n+1=(6a'+1)(6b'+1)$ (for some $a',b' \in \mathbb{N}$) or $6n+1=(6a'-1)(6b'-1)$ (for some $a',b' \in \mathbb{N}$) either way, contradicting the hypothesis.

If a number $n$ that cannot be expressed in the form $6ab \pm a \pm b$ then $6n \pm 1$ will be a prime pair & prime pairs can only be generated by $n$ with this property (apart from the pair $(3,5)$).

  • $\begingroup$ $6n-1=(6a+1)(6b-1)\iff n=6ab-a+b$ and not all $n$ can be written this way. $\endgroup$ – Piquito Jun 15 '17 at 22:41
  • $\begingroup$ For the most part I understand the argument, but I don't see why (for instance) $6n-1=(6a'+1)(6b'-1)$. Why can you make this very specific claim about the factors of $6n-1$? As far as I can tell, the only thing we can say for sure about $6n-1$ is that it can be decomposed into the product of two integers at least one of which is a prime (and therefore able to be written as $6a'\pm 1$). How do we know that it can definitely be written as the product of two numbers that differ from a multiple of 6 by 1 in the way you have written? $\endgroup$ – Geoffrey Jun 15 '17 at 23:38
  • $\begingroup$ If $m=6n-1$ then $m \equiv 5 \mod 6$. The only way to pair of numbers (modulo 6) that will multiply to give $5$ are $1$ & $5$. So if $M=AB$ then $A \equiv 1 \mod 6$ and $B \equiv 5 \mod 6$ (or the other way around) $\endgroup$ – Donald Splutterwit Jun 15 '17 at 23:48
  • $\begingroup$ Ah, of course. That makes perfect sense. Thanks for the answer! $\endgroup$ – Geoffrey Jun 15 '17 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.