2

A while back, I noticed an interesting identity that exists between two particular numbers, involving a cyclical shift of one number when represented in base $16$, so that it's equal to the cycled value in base $10$: $$2008_{16} = 8200_{10} $$ In this case it involves cyclically shifting the LHS once to the right (I actually also posted a couple more examples in this community wiki post here about surprising identities).

More recently, a friend that got interested in the idea showed me the output a Python program he wrote, and it found several more identities by exhaustive search. To give a few examples:

\begin{align*} 12575_{16} &= 75125_{10} && \text{ (2 cyclical shifts to the right)} \\ 15086_{16} &= 86150_{10} && \text{ (2 cyclical shifts to the right)} \\ 072468_{16} &= 468072_{10} && \text{ (3 cyclical shifts to the right/left)} \\ 036915494_{16} &= 915494036_{10} && \text{ (3 cyclical shifts to the left)} \end{align*}

Note that the last two can be taken as a weaker version of the identity, as it arguably employs a slight "cheat" of padding the base $16$ numbers with a zero to the left in that manner. Nonetheless they are also interesting.

My question is then, is there a quicker way than exhaustive search to find numbers that satisfy this cyclic relation, perhaps even a closed formula that can do that?

As an aside, I found out also that there's a similar concept of Cyclic numbers, and it seems like it may be related somehow. However, these don't involve comparing the representations of numbers in different bases like here.

Amit
  • 615

1 Answers1

2

You can reduce the amount of computation by removing possibilities that cannot work based on what you have so for. For example, in five figures we have $10000_{16}=65536_{10}$ so any solution will have $0$ or $1$ for the first figure in base $16$ and if it is $1$ the leading figure in base $10$ must be at least $6$. You can extend this as you build the number. If you decide the leading digit in base $10$ is $8$, we have $80000_{10}=13880_{16}$ and $90000_{10}=15F90_{16}$. The next digit in base $16$ must be $3$ to $5$ and we have accounted for three of the digits. Now you don't have many choices for what the rotation is and you are down to just a few possibilities to check. I used a similar strategy for my program that lead to 4494410 and friends. I didn't describe it there, just used the results

If you don't allow leading zeros there are no solutions with more that five digits as $100000_{16}=1048576_{10}$

Ross Millikan
  • 383,099