Keep factoring and concatenating to get a prime?

147 Views Asked by At

Keep factoring and concatenating,starting from $2$ until we get a prime.

$$2=2$$ $$22=2*11$$$$22211=7*19*167$$ $$22211719167=?$$ ...and so on (the prime factors are arranged from smaller to larger and their multiplicities are also written).

How far we can go with these? (because factorization is very hard)

3

There are 3 best solutions below

0
On BEST ANSWER

If you have Sage available somewhere, you can run this simple code (n is the initial value, b is the base):

n = 2
b = 10
while True :
    s = n.str(b)
    print n.is_prime(), s
    for p,k in factor(n) :
        s += (p.str(b))*k
    n = Integer(s,b)

The results I managed to get:

True 2
False 22
False 22211
False 22211719167
False 2221171916731111313195493
False 222117191673111131319549333123883568997108723797801
False 222117191673111131319549333123883568997108723797801909138725589671825928623195474482364099822833797133

Needed to say, the sequence either gets constant when you hit a prime, or grows so fast that the probability that there is a prime in $\geq k$th step is moreorless equal to the probability that the $a_k$ is a prime, which is $\frac{\ln a_k}{a_k}$. Good luck.

5
On

Using base $8$ arithmetic, it takes two steps:

$2 = 2$

$22 = 2\cdot2\cdot3\quad$ (In base $10$, this is: $\,\,18= 2\cdot2\cdot3$)

$22223\,\,$ is prime. (In base $10$: $\,\,9371$)

On the other hand, as @JMoravitz pointed out, in base $10$ the number gets big. I tried a different site and it too got stuck at $2221171916\ldots133$. It's hard to factor numbers with $104$ digits, but the primality test on the site I used indicates that this number is composite; good luck factoring the next one!

It's hard to answer questions like this because the answer depends very much on the way you choose to represent the numbers (e.g., base $10$) as opposed to any relationship from one number to the next.

0
On

If the initial seeds are 3,5,or 7 instead of 2,then we get a prime very quickly,i.e.33311,55511,and 77711 are all primes!. If 2 is the initial seed then that last number 22211719167.....797133 is divisible by 3 eight times(!)and it not divisible by any other primes less than 10^5