Maths Olympiad Prep

Library / /669 of 740

, 2015

Number theory Difficulty 5.6 AIME, harder Prove it United States

Problem:
Let nn be a three-digit integer with nonzero digits, not all of which are the same. Define f(n)f(n) to be the greatest common divisor of the six integers formed by any permutation of nn's digits. For example, f(123)=3f(123) = 3, because gcd(123,132,213,231,312,321)=3\operatorname{gcd}(123, 132, 213, 231, 312, 321) = 3. Let the maximum possible value of f(n)f(n) be kk. Find the sum of all nn for which f(n)=kf(n) = k.

Solution

Solution:
Let n=abcn = \overline{abc}, and assume without loss of generality that abca \geq b \geq c. We have k100a+10b+ck \mid 100a + 10b + c and k100a+10c+bk \mid 100a + 10c + b, so k9(bc)k \mid 9(b - c). Analogously, k9(ac)k \mid 9(a - c) and k9(ab)k \mid 9(a - b). Note that if 9n9 \mid n, then 99 also divides any permutation of nn's digits, so 9f(n)9 \mid f(n) as well; ergo, f(n)9f(n) \geq 9, implying that k9k \geq 9. If kk is not a multiple of 33, then we have kcakca<9k \mid c - a \Longrightarrow k \leq c - a < 9, contradiction, so 3k3 \mid k.

Let x=min(ab,bc,ac)x = \min(a - b, b - c, a - c). If x=1x = 1, then we have k9k \mid 9, implying k=9k = 9—irrelevant to our investigation. So we can assume x2x \geq 2. Note also that x4x \leq 4, as 2x(ab)+(bc)=ac912x \leq (a - b) + (b - c) = a - c \leq 9 - 1, and if x=4x = 4 we have n=951f(n)=3n = 951 \Longrightarrow f(n) = 3. If x=3x = 3, then since 3k100a+10b+c3a+b+c3 \mid k \mid 100a + 10b + c \Longrightarrow 3 \mid a + b + c, we have abc(mod3)a \equiv b \equiv c \pmod{3} (e.g., if bc=3b - c = 3, then bc(mod3)b \equiv c \pmod{3}, so abc(mod3)a \equiv b \equiv c \pmod{3}—the other cases are analogous). This gives us the possibilities n=147,258,369n = 147, 258, 369, which give f(n)=3,3,9f(n) = 3, 3, 9 respectively.

Hence we can conclude that x=2x = 2; therefore k18k \mid 18. We know also that k9k \geq 9, so either k=9k = 9 or k=18k = 18. If k=18k = 18, then all the digits of nn must be even, and nn must be a multiple of 99; it is clear that these are sufficient criteria. As nn's digits are all even, the sum of them is also even, and hence their sum is 1818. Since abca \geq b \geq c, we have a+b+c=183aa6a + b + c = 18 \leq 3a \Longrightarrow a \geq 6, but if a=6a = 6 then a=b=c=6a = b = c = 6, contradicting the problem statement. Thus a=8a = 8, and this gives us the solutions n=882,864n = 882, 864 along with their permutations.

It remains to calculate the sum of the permutations of these solutions. In the n=882n = 882 case, each digit is either 8,88, 8, or 22 (one time each), and in the n=864n = 864 case, each digit is either 8,68, 6, or 44 (twice each). Hence the desired sum is 111(8+8+2)+111(82+62+42)=111(54)=5994111(8 + 8 + 2) + 111(8 \cdot 2 + 6 \cdot 2 + 4 \cdot 2) = 111(54) = 5994.

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.