Maths Olympiad Prep

Library / /8 of 9

Number theory Difficulty 6.9 National Olympiad Prove it Italy

Problem:

Let XX be the set of natural numbers that in base ten are not written with a single digit repeated several times. For every nXn \in X we define AnA_{n} as the set of numbers obtained by permuting in all possible ways the digits of nn, and let dnd_{n} be the greatest common divisor of all the numbers of AnA_{n}. For example, if n=1120n=1120,
A1120={112,121,211,1012,1021,1102,1120,1201,1210,2011,2101,2110} A_{1120}=\{112,121,211,1012,1021,1102,1120,1201,1210,2011,2101,2110\}
and d1120=1d_{1120}=1 (112 and 121 are coprime). Determine the maximum possible value of dnd_{n}.

Solution

Solution:

The greatest common divisor of two numbers also divides their difference. If AA and BB are two distinct digits of nn with A>BA>B, the two numbers XXXABXXXAB and XXXBAXXXBA are in AnA_{n} (XXXXXX represents any sequence of the other digits of nn). Their difference is 9(AB)9(A-B).

The maximum value of ABA-B is 99, which is achieved only if A=9A=9 and B=0B=0. This shows that dnd_{n} is less than or equal to 8181. Let us now see that there exists an integer NN such that dN=81d_{N}=81. Such an NN must be formed only by digits 99 and 00 (otherwise one finds AA and BB as above, with AB<9A-B<9, while dN9(AB)<81d_{N} \leq 9(A-B)<81) and must itself be a multiple of 8181. Equivalently N/9N/9 must be formed only by digits 11 and 00 and must be a multiple of 99. By the divisibility rule for 99, the sum of the digits of N/9N/9 must be a multiple of 99, and therefore N/9N/9 must have at least 99 digits equal to 11.

The smallest integer in XX with these properties is 10111111111011111111, so NN is at least 90999999999099999999. On the other hand, if N=9099999999N=9099999999, one easily checks that all the numbers of ANA_{N} are divisible by 8181, and therefore dN=81d_{N}=81.

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 translated into English from it; metadata (topic, difficulty) added by this project.