Let $N$ be a 3-digit number with three distinct non-zero digits. We say that $N$ is mediocre if it has the property that when all six 3-digit permutations of $N$ are written down, the average is $N$. For example, $N = 481$ is mediocre, since it is the average of $\{418, 481, 148, 184, 814, 841\}$. Determine the largest mediocre number.
Problem
Source: Canada RepĂȘchage 2015/3
Tags: number theory, permutations, Average
18.06.2016 18:59
18.07.2022 23:26
for a in range(9): a=a+1 for b in range(10): for c in range(10): if 37*(a+b+c)==100*a+10*b+c: if a!=b and b!=c: print(a,b,c)for a in range(9): a=a+1 for b in range(10): for c in range(10): if 37*(a+b+c)==100*a+10*b+c: if a!=b and b!=c: print(a,b,c)RunResetPop Out /
19.07.2022 09:50
We have given a three digit number $(1) \;\; N = 100x + 10y + z$ with distinct digits $x,y,z$ s.t. the average of the sum $S$ of the six 3-digit permutations of $N$, is $N$. The sum $S = 222(x + y + z)$, which according to formula (1) give us (since ${\textstyle \frac{S}{6} = N})$ $(2) \;\; 100x + 10y + z = 37(x + y + z)$, i.e. $(3) \;\; 7x - 3y - 4z = 0$. Equation (2) implies $(4) \;\; 37 \mid -11x + 10y + z$. The fact that $-11 \cdot 9 + 10 \cdot 0 + 0 \leq -11x + 10y + z < -11 \cdot 0 + 10 \cdot 9 + 9$, i.e. $|-11x + 10y + z| < 100 < 111 = 3 \cdot 37$, which combined with condition (4) result in $(5) \;\; -11x + 10y + z = 37t, |t| \leq 2$. According to formulas (3) and (5) we obtain $7x - 3y - 4(37t + 11x - 10y) = 0$, yielding $(6) \;\; x = y - 4s$. Consequently by formulas (5) and (6) $z = 37t+ 11(y - 4t) - 10y = -7t + y$, which means $(7) \;\; (x,y,z) = (s - 4t,s,s - 7t), 0 \leq s \leq 9, |t| \leq 2$. If $t=0$, then $x=y=z$ by formulas (7), which is impossible since $x,y,z$ are distinct digits. If $|t|=2$, then $z = s - 7t = s \pm 14$ yielding $y>9$ if $t=-2$) or $y<0$ (if $t=2$). These contradictions implies $|t|=1$. If $t=-1$, then by formulas (7) $(x,y,z) = (s+4,s,s+7) = (4,0,7), (5,1,8), (6,2,9)$. Likewise, if $t=1$, then by formulas (7) $(x,y,z) = (s-4,s,s-7) = (3,7,0), (4,8,1), (5,9,2)$. Conclusion: There are exactly six 3-digit numbers $N$ satisfying the given conditions, namely $N = 370, 407, 481, 518, 592, 629$.