News for hackers. Stuff that matters.
Re:In Math Cram Sessions, Solving for Why by somethingroma on Monday September 10, 2018 @11:34AM (#17952524)
Additionally 9 * n = [n-1, 10-n] for n = 2-11; where n-1 is the digit in the 10's place and 10-n in the single place. This just an aesthetic curiosity. I know the pattern continues for larger n I've just never bothered to generalize it. Also never compared it to other bases.
Re:In Math Cram Sessions, Solving for Why by sdenton4 on Monday September 10, 2018 @07:41PM (#17956057)
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...

Re:In Math Cram Sessions, Solving for Why by Koshkin on Monday September 10, 2018 @12:45PM (#17953067)
> [n-1, 10-n] for n = 2-11

I think the usual 10 * n - n makes more sense and is much easier to remember.