Maths Olympiad Prep

Library / /17 of 18

Number theory Difficulty 5.7 AIME, harder Prove it United States

Problem:

Wally has a very unusual combination lock number. It has five digits, all different, and is divisible by 111111. If he removes the middle digit and replaces it at the end, the result is a larger number that is still divisible by 111111. If he removes the digit that is now in the middle and replaces it at the end, the result is a still larger number that is still divisible by 111111. What is Wally's combination lock number? Explain your answer!

Solution

Solution:

The solution is 7425974259. The numbers 7425974259, 7459274592, and 7492574925 are all divisible by 111111. Denote the original number by abcde\overline{abcde} (the line prevents confusion with abcdea \cdot b \cdot c \cdot d \cdot e). Then we have
111abcde111abdec \begin{aligned} & 111 \mid \overline{abcde} \\ & 111 \mid \overline{abdec} \end{aligned}
Subtracting,
111abdecabcde111deccde \begin{gathered} 111 \mid \overline{abdec} - \overline{abcde} \\ 111 \mid \overline{dec} - \overline{cde} \end{gathered}
Since the number deccde=90d+9e99c\overline{dec} - \overline{cde} = 90d + 9e - 99c is divisible by 99 we get 33deccde33 \mid \overline{dec} - \overline{cde}. Since it is given that abdec>abcde\overline{abdec} > \overline{abcde}, cdedec333\overline{cde} \leq \overline{dec} - 333.
However, we could have done the above logic with d,e,cd, e, c instead of c,d,ec, d, e and gotten dececd333\overline{dec} \leq \overline{ecd} - 333. Consequently cdeecd666\overline{cde} \leq \overline{ecd} - 666. Since obviously ecd999\overline{ecd} \leq 999, cde\overline{cde} is one of the multiples of 3737 up to 333333:
000037074111148185222259296333 000\quad 037\quad 074\quad 111\quad 148\quad 185\quad 222\quad 259\quad 296\quad 333
We can immediately eliminate 000,111,222000, 111, 222, and 333333, since we know that the digits are all different. We can also eliminate 074,185074, 185, and 296296, since ecd>dec\overline{ecd} > \overline{dec}. The three remaining choices are all of the form 111k+37111 \cdot k + 37. So
111abcde=ab000+cde=999ab+ab+111k+37111ab+37 \begin{aligned} 111 \mid \overline{abcde} & \\ & = \overline{ab000} + \overline{cde} \\ & = 999 \cdot \overline{ab} + \overline{ab} + 111 \cdot k + 37 \\ 111 \mid \overline{ab} + 37 & \end{aligned}
whence ab=74\overline{ab} = 74. This leaves only three possibilities for Wally's combination lock number: 7403774037, 7414874148, and 7425974259, of which only the last has all unlike digits.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.