Divisibility properties are best expressed using modular arithmetic. I’ll save on the notation but the idea is as follows:
Consider a number like `ABCD` where the letters are the digits. The number itself is equal to 1000 A + 100 B + 10 C + D. Whereas the sum of digits is A + B + C + D. We claim that these have the same remainder when divided by 3.
Well this is not hard to see because the difference – 999 A + 99 B + 9 C – is divisible by 3 and so has remainder 0 when divided by 3. Thus `ABCD` is divisible by 3 if and only if its sum of digits is.
This argument can easily be extended to all numbers (it’s just cumbersome to write on reddit). And by replacing 3 with 9 we get the same rule for 9.
Latest Answers