# Theory of removing alternate digits

It has been many years since I noticed something bizarre in our number system. It has caught my eye since then. In the beginning, I discarded it as something irrelevant, obvious maybe and something that was a mere illusion.

Start with a number, any four digit number will explain best and easiest. For example $6173$ (any random number). First remove the alternate digits from right side, i.e. the number becomes $67$ (removing $3$and $1$). Write$6173$ in front of it again. It becomes $617367$. Repeat the steps. $$1. 6173$$ $$67$$ $$2. 617367$$ $$676$$ $$3. 6173676$$ $$137$$ $$4. 6173137$$ $$133$$ $$5. 6173133$$ $$133$$

In four steps, we got a number 133 which will be repeated forever. I like to call this 'purest form of a number'. This is applicable to any digit number, any number till infinity.

Further, I observed that single digit numbers cannot be made any more 'pure'. They reach their purest form in one step. 2 digit numbers reach their purest form in 2 steps, 3 digit numbers in 4 steps, 4 digit numbers also in 4 steps. 5 digit ones in 5, 6 in 6, 7 in 6...

Writing them up in a series: $$1, 2, 4, 4, 5, 6, 6...$$

Alternate odd digit numbers don't purify in as many number of steps.

Now,1 digit numbers have 1 digit pure number, 2 have 1, 3 have 2, 4 have 3, 5 have 4, 6 have 5, 7 have 6 and so on.

This pattern becomes: $$1, 1, 2, 3, 4, 5, 6...$$

I studied removing alternate digits from the left side too. It is almost the same. Also, in the second last step of reaching the pure forms, the numbers get very very close in any instance. In the above example, 137 and 133.

My question is:

(a) Is this actually a good observation or just an obvious fact? (b) In any case, why are we sticking to a number which doesn't change after a few steps?

• I find it somewhat amusing that the random number you picked, $6173$, is just one less than the Kaprekar constant $6174$. en.wikipedia.org/wiki/6174_(number). – Tob Ernack Jul 14 '17 at 3:49
• Haha. Actually, I tried it with 123, 1234, 12345. I took different digits because I wanted to see what digits come and stick in the final. It is mostly the center ones. But to avoid things like "this isn't a random number", I didn't use 1234. – Kashish Arora Jul 14 '17 at 4:14
• I was unaware of Kaprekar's constant. The concept is actually more or less the same. I am amused too how I ended up using 6173. That is a big coincidence. If it would have been any other significant four digit number, it wouldn't have been a big deal. But this concept is quite similar. – Kashish Arora Jul 14 '17 at 4:36

## 1 Answer

For the number of digits, suppose your original number has $n$ digits and the pure number has $p$ digits. When you prepend the original number you get $n+p$ digits. If $p=n-1$ or $p=n$ you will then strike out $n$ digits, leaving you again with $p$. On the first strike you bring the number of digits below $n$ and can never get back. That justifies (with $n=1$ a special case) your number of digits observation.

Once you get to $p$ digits there are only $10^p$ numbers to choose from, so you will eventually cycle. We can easily find the only 1-cycle. We will show an example for a starting seven digit number. The starting number might as well be $0123456$. We know the pure number will have six digits. Let them be $abcdef$. When you prepend the original number you get $0123456abcdef$. After you strike out the digits you have $135ace$, which we can equate to $abcdef$. This gives $a=1, b=3, c=5, d=a=1, e=c=5, f=e=5$, for a final answer of $135155$ for seven digit numbers. You can do the same for any length you like.

Each number goes through two phases in getting to the pure number. The first is to grow the prepended version in length up to the required amount. That takes about $\log_2 n$ iterations. In the seven digit example it goes from $7$ to $10$ because you strike four the first time, then to $12$, then to $13$. After that the length stays constant and the numbers shift in from the left, again taking about $\log_2 n$ iterations. The first $n$ shift in the first time, then the next $n/2$ are shifted in, then the next $n/4$. The total number of iterations is about $2 \log_2 n$. I haven't thought about how the rounding affects this, which is where "about" comes from.

The pure number will start with the digits from the odd positions of the starting number, followed by the digits that are $1$ or $3 \pmod 4$ depending on whether $n$ is even or odd, and so on.

• Well, I was headed for a general answer and focussed on some other things more, but this is it. For now, I am actually preparing a recurring software to prove that the purest number actually sticks. A mathematical general proof, however will have to wait then, I guess. – Kashish Arora Jul 14 '17 at 4:23
• Can you figure out from this general answer why in the second last step you get very close to the purest form when you don't have any algebraic calculations? In most cases, there is a difference of 1-2. In the one I chose, there is a difference of 4. – Kashish Arora Jul 14 '17 at 4:26
• It is because my neighboring digits differ by $1$. If you did the same calculation you did with $0123$ you would get the same 1-cycle of $133$ because those digits are in the same positions as mine, but the second last step would be $132$ because the third digit is $2$. You shouldn't focus on the digit values, just on their positions in the starting number. If we start with $5678$ the final value will be $688$ based on the digit positions. – Ross Millikan Jul 14 '17 at 4:29
• Your edited answer provides for most of the shortcomings in mine. – Kashish Arora Jul 16 '17 at 14:23