Let be a three-digit integer with nonzero digits, not all of which are the same. Define to be the greatest common divisor of the six integers formed by any permutation of s digits. For example, , because . Let the maximum possible value of be . Find the sum of all for which .
Solution
Let , and assume without loss of generality that . We have and , so . Analogously, and . Note that if , then 9 also divides any permutation of s digits, so as well; ergo, , implying that . If is not a multiple of 3 , then we have , contradiction, so . Let . If , then we have , implying - irrelevant to our investigation. So we can assume . Note also that , as , and if we have . If , then since , we have (e.g. if , then , so - the other cases are analogous). This gives us the possibilites , which give respectively. Hence we can conclude that ; therefore . We know also that , so either or . If , then all the digits of must be even, and must be a multiple of 9 ; it is clear that these are sufficient criteria. As 's digits are all even, the sum of them is also even, and hence their sum is 18. Since , we have , but if then , contradicting the problem statement. Thus , and this gives us the solutions along with their permutations. It remains to calculate the sum of the permutations of these solutions. In the case, each digit is either 8,8 , or 2 (one time each), and in the case, each digit is either 8,6 , or 4 (twice each). Hence the desired sum is .