1) I missed to explain that I was accepting leading zeros from the first
2) I made a mistake when I wrote that for K=3, the smallest prime was
1021; it should have been 1009.
E&O&T means the concatenations of E, O and T.
Contributions came from Giovanni Resta, Fred Schalekamp, Gaurav Kumar,
Emmanuel Vantieghem, Antoine Verroken and Farideh & Jahangeer
Q1. This is easy. Simply prove it for all numbers with, say,
four digits 'by hand' (by PC is also allowed) and prove the general
statement by induction : every five- or more-digit number is
transformed by the rule in a number with fewer digits...
Q2. K = 1. Smallest number = 101 = Smallest prime
K = 2. Smallest number = 2 = Smallest prime
K = 3. Smallest number = 20 ; smallest prime = 1009 (and
K = 4. Smallest number = 11 = smallest prime
Q3. K = 5. Smallest number = 1 ; Smallest prime = 3
Indeed, define the function F by the rule F(m) = E&O&T.
The chain obtained by the itteration of F is then :
3 -> 11 -> 22 -> 202 -> 303 -> 123
However, I think that the really tough problem is to find a chain
of length 6 (or longer).
Here is how I constructed a chain of infinite length :
... -> X(n+1) -> X(n) -> ... -> X(2) -> X(1) -> 123
with X(1) = 145, X(2) = 11011, X(3) = 11111011111,
X(4) is a number with 11111 digits, all ones except the
middlest which is zero.
Thus, X(4) is of the form
where A is the repunit consisting of 5555 ones.
Further, X(5) will be of the form
where B is the repunit consisting of (A-1)/2 ones.
Further, X(6) will be of the form
where C is the repunit consisting of (B-1)/2 ones, etcetera.
In that way we can extend the chain to the left ad infinitum !
If we ask for the smallest number m with K = 6, we must
replace X(6) by the smaller number obtained by moving the middlest
0 to the second position from the left. Thus, m will be of the
form 1011...11 = 1&0&M, where M is the repunit
with 2C-1 ones. Since F(m) is obviously the same as F(X(6)),
m -> F(m) -> F(F(m)) -> ...
ends with the same tail.
However, I cannot prove that m is effectively the smallest
But that number is tremendously big so that perhaps no one can
have an idea what will be the smallest prime ...