| Modulo 9, a decimal integer is equal to the sum of its digits. More precisely, congruent, notated by ≡: For instance 123 ≡ 1+2+3 ≡ 6 (mod 9). We show congruences using ≡, and always have (mod N) on the far right to indicate the modulus for the congurence. More generally, if ABC is a decimal string, then we know that ABC ≡ A + B + C (mod 9). Moreover ABC + DEF + GHI must be congruent to A+B+C + D+E+F + G+H+I (mod 9). And if ABC + DEF + GHI is equal to 123J, then A+B+C + D+E+F + G+H+I ≡ 123J ≡ 1+2+3+J (mod 9). Thus: A+B+C+D+E+F+G+H+I ≡ 1+2+3+J (mod 9) Now suppose we add J to both sides: A+B+C+D+E+F+G+H+I+J ≡ 1+2+3+J+J (mod 9) OK so now we know that the left hand side A+...+J contains all elements from 0 to 9, because of the problem constraint that the letters represent unique digits. The numbers 0 to 9 add together to 45. Now 45 is congruent to 0 (mod 9). Therefore: A+B+C+D+E+F+G+H+I+J ≡ 45 ≡ 0 ≡ 6 + 2J (mod 9) We no longer care about the A+..+J; it's vanished. We solve the remaining equation: 0 ≡ 6 + 2J (mod 9) If 6 + X (mod 9) is congruent to 0, X must be one of {... -6, 3, 12, 21, 30, 39 ...}: the set of integers congruent to 3, (mod 9). If X = 2J, where J is a one-digit decimal integer, X must be an even, non-negative integer. That rules out -6, 3 and 21. It can't be 30, because J can't be 15. X must be 12, which gives J = 6. |
> Modulo 9, a decimal integer is equal to the sum of its digits. More precisely, congruent, notated by ≡:
> For instance 123 ≡ 1+2+3 ≡ 6 (mod 9).
This is the part where the parent comment's explanation was helpful.