Generating new prime number by adding $40$ to larger number of twin primes

104 Views Asked by At

A long time ago one of my classmates claimed he discovered a formula for prime numbers and he became so famous among students and our teacher.

If we have two digits twin prime numbers (primes which differ by two) by adding $40$ to larger number we can generate a prime number.

For example consider $(11,13)$ then $53$ is also prime or for $(71,73)$, $113$ is also a prime number.

Amazingly it works for all two digits numbers! However its weakness is that it only works for two digit numbers.

So I wonder was it a known formula and my classmate found it somewhere or he really did discovered it?

Also is it possible to prove this works without checking for all two digits twins ?

2

There are 2 best solutions below

0
On

This is partly because in many cases the larger one of the $2$-digit twin-prime numbers is of the form $n(n+1)+1$. So adding $40$ gives a prime. This is a consequence of the well-known prime generating formula $f(n)=n^2+n+41$. First contradiction occurs at $n=41$, which gives a 3-digit composite number. There are only $2$ exceptions, $(17,19)$, and $(59,61)$, these are coincidental.

1
On

The observation is best explained by the strong law of small numbers. Notice that the posited relationship fails for the single digit twin prime $3,5$ but holds for the single digit twin prime $5,7$. Restricting matters to two digit twin primes is just cherry-picking initial conditions to make a coincidence look more special than it is. Moving to three digit twin primes doesn't eliminate the phenomenon, it just renders it less frequent so that the occurrence of the relationship becomes stochastic rather than absolute.

$40=6\cdot 7-2 \equiv -2 \bmod 6$. Recall that all primes $p \ge 5$ have the form $6k \pm 1$. The larger member of such a set of twin primes will have the form $6k+1$, so $6k+1 +40=6(k+7)-1$. Notice that for primes of the form $6k-1$, the only values of $k<20$ which do not give rise to a prime are $\{6,11,13,16\}$ see OEIS A024898.

The values of $k$ for which $6k \pm 1$ is a twin prime are given in OEIS A0002822. For twin primes of less than three digits, that list is $k=\{1,2,3,5,7,10,12\}$. The corresponding list of $k+7$ would be $k+7=\{8,9,10,12,14,17,19\}$.

By happenstance alone $\{6,11,13,16\} \cap \{8,9,10,12,14,17,19\}=\{\emptyset\}$, accounting for the observation.