News for hackers. Stuff that matters.
Re:A happy numeric coincidence by hinkley on Wednesday January 02, 2019 @11:50AM (#18807553)
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.]

Re:A happy numeric coincidence by gweinberg on Wednesday January 02, 2019 @04:41PM (#18810515)
Something 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.

Re:A happy numeric coincidence by midgetjones on Wednesday January 02, 2019 @11:55AM (#18807609)
But not all of the numbers are multiples of 9
Re:A happy numeric coincidence by white-flame on Wednesday January 02, 2019 @06:40PM (#18811446)
The 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.

Re:A happy numeric coincidence by AGoodName on Wednesday January 02, 2019 @12:11PM (#18807782)
The 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.