I came across the following curious problem while playing around with my calculator.
Take any positive integer $n$; for this example we'll use $216$. Create a sequence as follows:
- Factor $n$ into its prime factors, listing smaller factors first and expanding exponents; $216=2\times2\times2\times3\times3\times3$
- Create the next number by concatenating the first $d$ digits of its prime factors, where $d$ is the number of digits in $n$; $2\times2\times2\times3\times3\times3\to222$
- Repeat until...? $222\to2\times3\times37\to233\to233\to\cdots$
The first thing that is easy to show is that you will always be able to create a $d$-digit number at any step.
The sequence obviously stops once it hits a prime number. But can it stop for any other reason? It turns out that the first number whose sequence does not end in a prime number is $333$, a composite which miraculously generates itself: $333=3\times3\times37\to333$.
A quick computer program found several other numbers that exhibit this property:
- $2255\to5114\to2255\to\cdots$ a loop!
- $22222\to24127\to23104\to22222\to\cdots$ a longer loop!
- $22564\to22564\to\cdots$
- $31111\to53587\to41130\to23354\to21167\to61347\to31111\to\cdots$ !!!
- $210526\to210526\to\cdots$
- $252310\to252310\to\cdots$
- $1143241\to1143241\to\cdots$
- $3331233\to3331233\to\cdots$
- $3710027\to3710027\to\cdots$
Update: up to 150 million, I found
- $219371601\to367109140\to225183554\to219371601\to\cdots$
I'll call these numbers, whose sequence does not end in a prime, self-factoring numbers. As far I've tested, these are all the self-factoring numbers below forty million.
This topic may have no depth to explore (it may just be a fun mathematical coincidence), but I would still like to pose the following questions:
- Are these self-factoring numbers related in any way? Can we prove any property about these numbers at all?
- Is there any property that might help speed up a computer search past the brute force approach?
- Are there infinitely many such self-factoring numbers? Could there be a constructive proof?