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

1.6k Views Asked by At

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!

2

There are 2 best solutions below

0
On 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.

1
On

Assume x > 0. Let x == a0 + 10a1 +...+ an10^n where 0 <= ai <= 9, n >=0, the usual decimal expansion. Then 2x == an + 10a1+...+a010^n, so x == (an-a0) + (a0-an)10^n since x == 2x - x. Clearly, a0 != an and an is even. If a0 < an, then 0 < (an-a0) < 10 and -10^n > (a0-an) so x < 0. Contradiction. So a0 > an. Also, if a0 < 5, x == 2x implies an == 2a0, which contradicts the above. So a0 == 6,7,8 or 9. Thus an == 2,4,6 or 8, the modulus 10 of 2*a0.

So candidates are 2?6, 4?7, 6?8 or 8?9, where ? is some fixed string of digits. But 2*(2?6) < 6?2, 2*(4?7) > 7?4, 2*(6?8) > 8&6 and 2*(8?9) > 9?8. So there is no solution.