2 ms·
Nice math hack. The 11 and 7 ones were new to me. Here's some more fun: http://www.jgc.org/blog/2008/02/sum-of-first-n-odd-numbers-is-always.html http://www.
by jgrahamc 19y ago
Nice math hack. The 11 and 7 ones were new to me.
Here's some more fun: http://www.jgc.org/blog/2008/02/sum-of-first-n-odd-numbers-is-always.html http://www.jgc.org/blog/2008/02/sum-of-first-n-odd-numbers-i...
- staticshock 19y ago7 was new to me too, that's an odd one there's also another trick for 11 that comes from addition. 1234 * 11 = 12340 + 1234 = 13574 (or, by digit: 1 (1+2) (2+3) (3+4) 4). that makes 3 digit multiples easy to detect. for instance, 484: 8 is clearly 4+4, so it's divisible by 11 (440 + 44). it's slightly more tedious for >3 digit numbers. for instance, 1353: from left to right: 3 = 1 + ..2, 5 = 2 + ..3. 3 == 3, so it'd divisible by 11. i guess i explained this somewhat poorly, sorry for that. it's also somewhat harder if you have carries.
- philh 19y agoWhat I use for 11 is take the final digit, subtract the penultimate, add the third last, etc. The result = the original number (mod 11). Obviously it works if you start at the MSD, but then you need to worry about whether there's an even number of digits, in which case you need to negative the answer. Seven wasn't new to me, but I've never been able to remember it. Maybe I will this time.