Maths Olympiad Prep

Library / HMMT November /604 of 672

HMMT November, 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=abc‾n = \overline{abc}, and assume without loss of generality that a≥b≥ca \geq b \geq c. We have k∣100a+10b+ck \mid 100a + 10b + c and k∣100a+10c+bk \mid 100a + 10c + b, so k∣9(b−c)k \mid 9(b - c). Analogously, k∣9(a−c)k \mid 9(a - c) and k∣9(a−b)k \mid 9(a - b). Note that if 9∣n9 \mid n, then 99 also divides any permutation of nn's digits, so 9∣f(n)9 \mid f(n) as well; ergo, f(n)≥9f(n) \geq 9, implying that k≥9k \geq 9. If kk is not a multiple of 33, then we have k∣c−a⟹k≤c−a<9k \mid c - a \Longrightarrow k \leq c - a < 9, contradiction, so 3∣k3 \mid k.

Let x=min⁡(a−b,b−c,a−c)x = \min(a - b, b - c, a - c). If x=1x = 1, then we have k∣9k \mid 9, implying k=9k = 9—irrelevant to our investigation. So we can assume x≥2x \geq 2. Note also that x≤4x \leq 4, as 2x≤(a−b)+(b−c)=a−c≤9−12x \leq (a - b) + (b - c) = a - c \leq 9 - 1, and if x=4x = 4 we have n=951⟹f(n)=3n = 951 \Longrightarrow f(n) = 3. If x=3x = 3, then since 3∣k∣100a+10b+c⟹3∣a+b+c3 \mid k \mid 100a + 10b + c \Longrightarrow 3 \mid a + b + c, we have a≡b≡c(mod3)a \equiv b \equiv c \pmod{3} (e.g., if b−c=3b - c = 3, then b≡c(mod3)b \equiv c \pmod{3}, so a≡b≡c(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 k∣18k \mid 18. We know also that k≥9k \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 a≥b≥ca \geq b \geq c, we have a+b+c=18≤3a⟹a≥6a + 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(8⋅2+6⋅2+4⋅2)=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,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

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