Some numbers seem to have an internal choreography. Move one digit, and instead of becoming scrambled, the number turns into exactly twice itself.

The Number That Doubles When You Move a Digit

Riddle statement

Find all positive integers with this property:

  • take the last digit and move it to the front;
  • the number obtained is exactly twice the original number.

What are the shortest solutions? And does the family end there?

Show solution

Solution

The shortest solutions have 18 digits. There are eight of them:

$ \begin{aligned} 105263157894736842&\to210526315789473684,\\ 157894736842105263&\to315789473684210526,\\ 210526315789473684&\to421052631578947368,\\ 263157894736842105&\to526315789473684210,\\ 315789473684210526&\to631578947368421052,\\ 368421052631578947&\to736842105263157894,\\ 421052631578947368&\to842105263157894736,\\ 473684210526315789&\to947368421052631578. \end{aligned} $

In each line, the number on the right is twice the number on the left and is obtained by moving the last digit to the front.

Here is where they come from. If the last digit is $d$ and the rest of the number is $A$, then the number is $10A+d$. If $A$ has $k$ digits, moving $d$ to the front gives:

$ d\cdot10^k+A. $

The condition requires:

$ d\cdot10^k+A=2(10A+d), $

so:

$ 19A=d(10^k-2). $

Since $d$ is between 1 and 9, we need:

$ 10^k\equiv2\pmod{19}. $

The first time this happens is $k=17$, and it happens again every 18 positions. For $k=17$, the digit $d=1$ would produce a block $A$ with a leading zero, so it does not give an 18-digit solution; the digits $d=2,3,\ldots,9$ produce exactly the eight solutions above.

The family does not end there. For every:

$ k\equiv17\pmod{18} $

and every $d\in\{2,3,\ldots,9\}$, the formula

$ A=\frac{d(10^k-2)}{19} $

generates another solution.

Answer: there are eight minimal 18-digit solutions and then infinite families, with lengths 36, 54, 72, ... digits.