|
|
|
|
|
by sdenton4
2840 days ago
|
|
It's not an aesthetic curiosity at all! 10 is equal to 1 mod 9... So suppose X is written in base 10 (a0 * 10^0 + a1 * 10^1 + a2 * 10^3 +...) and you want to find X mod 9. Then all of the 10^k's are just 1 (mod 9), so you just get the sum of the digits. So if X is divisible by 9, then the sum of the digits (mod 9) is zero. Same works for 3 (x is div by 3 iff the sum of the digits id divisible by 3). And 11 gets an /alternating/ sum of the digits, since 10 is -1 mod 11... |
|