4 ms·
All multiples of 9 have digits that add up to 9. This is something kids learn. Why does it work? 9 is 10 - 1, so every time you add another nine the tens digit
by hinkley 8y ago
All multiples of 9 have digits that add up to 9. This is something kids learn. Why does it work? 9 is 10 - 1, so every time you add another nine the tens digit goes up by one and the ones digit down by one, maintaining the sum of digits. Similar thing happens at three digits, four digits, etc, because 9 < 10, no digit other than the ones digit ever goes up by more than 1, and a 9 becomes a 0 when you carry a one.
That this pattern didn’t swamp the results makes me wonder what kind of bug the author has in the scanning code.
[edit: seems I forgot about situations like 9 x 11 x N, where the digits can add up to 18, 27, etc due to all the 8 and 9 digits, so the algorithm will only find multiples of 9 with lots of small digits in it.]
- midgetjones 8y agoBut not all of the numbers are multiples of 9
- AGoodName 8y agoThe digits add to 0 in mod 9 and he's looking for precisely 9. eg. the sum of digits for 9^3 = 18. That's why you don't see 9's everywhere.
- gweinberg 8y agoSomething lie that happens in all bases e.g. in base 8 all multiples of 7 add up to 7 (if you keep adding), in hex all multiples of f add up to f, and in binary everything eventually adds up to 1 (except zero). Similarly, in base 8 7^2 is 61 and in hex f^2 is e1. (n-1)^2 = n^2 - 2*n + 1 = n(n-2) + 1 which in base n is written with n-2 as the fist digit and 1 as the second digit.
- white-flame 8y agoThe omission is that it's simply recursive. You might add the digits up to 36, whose digits then add up to 9. Simply reapply to the sum if the sum has more than 1 digit, and you'll still arrive at 9.