Saturday 31 August 2013

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?


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.


No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...