Maths Olympiad Prep

Library / /243 of 348

Number theory Difficulty 5.0 AIME, harder Find the answer

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.

A number or a short expression. Spacing and $ signs are ignored.

Solution

Let n=abcn=\overline{a b c}, and assume without loss of generality that abca \geq b \geq c. We have k100a+10b+ck \mid 100 a+10 b+c and k100a+10c+bk \mid 100 a+10 c+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 9 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 3 , 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)=ac912 x \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|k| 100 a+10 b+c \Longrightarrow 3 \mid a+b+c, we have abc(mod3)a \equiv b \equiv c(\bmod 3) (e.g. if bc=3b-c=3, then bc(mod3)b \equiv c(\bmod 3), so abc(mod3)a \equiv b \equiv c(\bmod 3) - the other cases are analogous). This gives us the possibilites 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 9 ; 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 18. Since abca \geq b \geq c, we have a+b+c=183aa6a+b+c=18 \leq 3 a \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,8 , or 2 (one time each), and in the n=864n=864 case, each digit is either 8,6 , or 4 (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: Omni-MATH, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.