[Math] Extending prime numbers digit by digit while retaining primality

decimal-expansionelementary-number-theoryprime numbersrecreational-mathematics

I looked at a table of primes and observed the following:

If we choose $7$ can we concatenate one digit to the left so as to form a new prime number? Yes, concatenate $1$ to obtain $17$. Can we do the same with $17$? Yes, concatenate $6$ to obtain $617$. And with $617$? Yes, concatenate $2$ to obtain $2617$. Then we can form $62617$. And I could not continue since table gives primes with the last entry $104729$.

Now some terminology. Call a prime number $a_1…a_k$ a survivor of order $m$ if there exist $m$ digits $b_1,…,b_m$ (all different from zero) so that the numbers $b_1a_1…a_k$ and $b_2b_1a_1..a_k$ and… and $b_mb_{m-1}…b_1a_1…a_k$ are all prime numbers.

Call a prime number $a_1…a_k$ a survivor of order $+ \infty$ if $a_1…a_k$ is a survivor of order $m$ for every $m \in \mathbb N$.

I would like to know:

Does there exist a survivor of order $+ \infty$?

Also asked on MO, with exactly the same title and content.

Best Answer

In short, highly improbable.

I find it interesting that computed data for "small enough" primes suggests $m_{\text{max}}\approx23\ll \infty$.


This problem looks like a generalization of left-truncatable primes, which are all known and finite.

The only difference is, that you are additionally allowing the starting point (end point) of the truncating sequence to not only include one digit primes, but any prime; (Here, we are not truncating until the last digit, but until the last prime instead).

Because of this, your question cannot be solved by an exhaustive search like left-truncatable primes, and a proof for a largest order survivor will be hard (rigorously proving it exists).

Take for example that whether there are infinitely many of deletable primes is still an open question - they have a similar rule of appending digits, and are also unable to be cracked via exhaustive search.

That's why I'll try to provide some computational data.


I would offer some data for a conjecture that the largest such $m$ is $\approx 23$ and could be in fact, the largest left-truncatable prime.

That is, the left-truncatable longest prime is $357686312646216567629137$, $a_1=7$, $m=23$.

After analyzing first $5\cdot10^5$ primes in PARI/GP, we have:

$$\begin{matrix} I & [10^0,10^1] & [10^1,10^2] & [10^2,10^3] & [10^3,10^4] & [10^4,10^5] & [10^5,5\cdot10^5] \\ m_{\text{avg}} & 14.5 & 13.4396 & 9.1032 & 6.1950 & 4.2134 & 3.3898 \\ m_{\text{max}} & 23 & 22 & 21 & 21 & 20 & 20\\ A_{\text{max}} & 7 & 37 & 739 & 89071 & 154079 & 3759461\\ n_{\text{max}} & 4. & 12. & 131. & 8628. & 14196. & 267350. \end{matrix}$$

Where $m_{\text{avg}}$ is the average order $m$ among primes $A_n,n\in I$, where $m_{\text{max}}$ is the largest order among primes $A_n,n\in I$, and $A_{\text{max}}=a_1,\dots,a_k$ is the survivor of the largest order.

Record holders in intervals $I$:

$B_{\text{max}}=\color{red}{b_{m_{\text{max}}},\dots,b_1}$ the digits appended to it $A_{\text{max}}=\color{blue}{a_1,\dots,a_k}$:

$$\begin{array}{lc} \color{red}{35768631264621656762913}\color{blue}{7}&m=23\\ \color{red}{3576863126462165676291}\color{blue}{37}&m=22\\ \color{red}{267248393498162799393}\color{blue}{739}&m=21\\ \color{red}{383469833999336159769}\color{blue}{89071}&m=21\\ \color{red}{73573324843923499983}\color{blue}{154079}&m=20\\ \color{red}{62361989426669156678}\color{blue}{3759461}&m=20 \end{array}$$

By going for larger and larger primes, we are expecting less prime extensions and on average shorter prime extensions (As Peter's answer suggests), which is now also tangible based on this computed data.

Of course it is still possible that there are large primes that'll have $m\gt23$;

But regarding $m\to\infty$, I would bet against it.


Update: Don't let $m_{\text{max}}$ on $I=[10^i,10^{i+1}]$ being $=23,22,21,21,20,20,\dots$ deceive you.

The first examples that break the pattern of decreasing $m_{\text{max}}$ values (given in the above table):

$$\begin{array}{clc} 538834. & \color{red}{963154572334953666616}\color{blue}{7984759} & m = 21 \\ 593591. & \color{red}{3263756913965427392633}\color{blue}{8857817} & m = 22 \end{array}$$

Going beyond $5\cdot10^5$th prime, I can't find $m\gt23$, the best I'm finding is $m=22$ (so far).

Maybe someone with a stronger search can try to find a new record and beat $A_4=7, m=23$ ?