[Math] Finding numbers that double when you switch the first and last digit

linear algebranumber theory

So, I was watching this video by MindYourDecisions about finding the smallest number that doubles when you move the last digit to become the first digit. Actually, I just saw the title of the video, and I found it interesting, so I began to work on a solution. But, in fact, I had misinterpreted the question posed by the video.

I was looking for a number that doubles when you switch the first and last digits of a number. I started off my search by writing equations like:

$$ 2(10a + b) = 10b + a $$

This simplifies to:

$$ 19a = 8b$$

Since $a$ and $b$ should be integers between 0 and 9 inclusive, I figured out that there are no solutions amongst two-digit numbers.

Next, I applied this technique to three and four digit numbers, getting this equation for three digit numbers (using the convention that $a$ is the first digit, $b$ is the second, and so on):

$$ 199a + 10b = 98c $$ And for four-digit numbers,
$$ 1999a + 100b + 10c = 998d $$

Next, I made tables varying the value of $a$ and the last digit between 0 and 9, looking for numbers that were close enough so that the smaller terms in the middle could make up the difference.

I couldn't find any solutions; however, I was able to find near misses such as 37, 397, 3997, or generally, a 3 followed by a string of 9s followed by a 7, which all differ by just one.

I am wondering if there actually are any solutions to this problem, and if not, how you would go about proving that.

Thank you!

Best Answer

We may represent integer $\ n>0\ $ as $\ n\ =\ b\cdot 10^d+M\cdot 10 + a\ $ (so that $\ a>0\ $ or $\ M>0\ $ or else we would have $ a=M=b=0)\ $ so that

$$ 2\cdot(a\!\cdot\! 10^d + M\!\cdot\! 10 + b) \ =\ b\!\cdot 10^d+M\!\cdot 10 + a $$

where $\ a\ b\ $ are decimal digits (i.e. $\ 0\ldots 9),\ $ and $\ M\ $ is a non-negative integer such that $\ M<10^{d-1}.$ Equivalently,

$$ (2\!\cdot\! 10^d-1)\!\cdot a + 10\!\cdot\!M \,\ =\,\ (10^d-2)\!\cdot\! b $$ or $$ b\,\ =\,\ 2\!\cdot\!a\ +\ \frac{10\!\cdot\!M\ +\ 3\!\cdot\!a}{10^d-2} $$

Thus, $$ 0\ <\ b-2\cdot a\ = \frac{10\!\cdot\!M\ +\ 3\!\cdot\!a}{10^d-2}\ \le\ 1\ +\ \frac{3\cdot a-8}{10^d-2} $$

Also if we had $\ d\ge 2\ $ then this very last fraction has an absolute value $\ < 1\ $ so that

$$ \frac{10\!\cdot\!M\ +\ 3\!\cdot\!a}{10^d-2}\ =\ 1 $$

while, knowing that $\ a<5\ $ (of course!),

$$ 10\!\cdot\!M\ +\ 3\!\cdot\!a\,\ \not\equiv \,\ 10^d-2\quad \mod 10 $$

This contradiction shows that $\ d\le 1.\ $ Thus there are only 2-digit solutions (if any). In particular, $\ M=0.\ $ This simplifies the equation:

$$ 19\cdot a\ \ =\ \ 8\cdot b $$

However, $19$ does not divide $\ 8\cdot b.\ $ Thus, after all,

$\qquad\qquad$ THERE ARE NO SOLUTIONS.

Related Question