Maths Olympiad Prep

Library / /22 of 28

, 2024

Number theory Difficulty 5.7 AIME, harder Prove it United States

Problem:

Compute the smallest positive integer such that, no matter how you rearrange its digits (in base ten), the resulting number is a multiple of 6363.

Solution

Solution:

First, the number must be a multiple of 99 and 77. The first is easy to check and holds for all permutations. Note that when two adjacent digits aa and bb are swapped, the number changes by 9(ab)10k9(a-b) \cdot 10^{k} (we disregard sign), so 9(ab)9(a-b) must also be a multiple of 6363 for all digits aa and bb. In particular, this is sufficient, since a permutation can be represented as a series of transpositions.

This means that aba-b must be a multiple of 77 for all digits aa and bb, so either all digits are equal or they are in {0,7},{1,8}\{0,7\},\{1,8\}, or {2,9}\{2,9\}. We find the minimum for each case separately.

We first provide the following useful fact: the first repunit (numbers 1,11,111,1,11,111, \ldots ) that is a multiple of 77 is 111111111111. This is because 10mod7=310 \bmod 7=3, and 33 is a generator modulo 77 (of course, you can just compute the powers of 33 by hand, and it will not take much longer).

If a number k11k \cdot 1 \ldots 1 is a multiple of 6363, then either kk or 111 \ldots 1 is a multiple of 77; if it is kk, then it's clear that we need 777777777777777777 to make the sum a multiple of 99. If 111 \ldots 1 is a multiple of 77, then it is at least 111111111111, then to make a multiple of 99, we need 333333333333.

If the only digits are 77 and 00, then we need at least nine sevens to make the digit sum a multiple of nine, which has more digits than 333333333333.

If the only digits are 88 and 11, then we can note that since 88 and 11 are both 1(mod7)1(\bmod 7), these numbers are equivalent to the repunits modulo 77, so such numbers have at least six digits. The best such six-digit number with digits summing to a multiple of 99 is 111888111888, which is our new candidate.

If the only digits are 99 and 22, then by analogous logic such numbers have at least six digits. But the smallest such number is 999999999999, which is not better.

So our best answer is 111888111888. It works.

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.