3 ms·
>This is starting to look very similar to "if you repeatedly add all the digits of an integer represented in base 10 representation until you have a single digi
by Arnavion 3y ago
>This is starting to look very similar to "if you repeatedly add all the digits of an integer represented in base 10 representation until you have a single digit, and the result is 3, 6 or 9, then it is divisible by 3". I forgot the exact explanation for that one, but IIRC has to do with the implicit calculation that is embedded in base 10 positional notation
Yes. The number "xyz" is 100x + 10y + z. Each power of 10 can be split into 1 plus a multiple of 9, ie (x + y + z) + (99x + 9y). The second group where all the components are a multiple of 9 is of course divisible by 9 and by 3. The first group is the sum of the digits. So if the sum of the digits is divisible by 3, then the original number was divisible by 3. If the sum of the digits is also divisible by 9, then the original number was also divisible by 9. If the sum of the digits is not divisible by 3, the original number was not divisible by 3 either.
This generalizes to any number of digits, and to any base N for testing divisibility by N-1 or factors of N-1.