Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do math contests competitively, so I remember these things. Here are some rules:

Divisibility by 2: Last digit is divisible by 2 (0, 2, 4, 6, or 8).

Divisibility by 3: Sum of digits is divisible by 3. (You can repeatedly sum the digits until the sum is small enough to manage easily.)

Divisibility by 4: Last two digits are divisible by 4 (00, 04, 08, 12, ...). If you don't know your multiples of four, you can divide the two digits by 2 and then see if it's even.

Divisibility by 5: Last digit is divisible by 5 (0 or 5).

Divisibility by 6: Divisible by 2 and by 3. (Works similarly for all composite numbers, of course. Like 10, 14, 15, etc. Make sure the factors you're checking are relatively prime (share no common factors), or it won't work. For example, divisibility by 2 and 6 does not imply divisibility by 12.)

Divisibility by 8: Last three digits are divisible by 8 (000, 008, 016, ...). Probably faster to divide the last three by 2 at least once then check divisibility by 4.

Divisibility by 9: Sum of digits is divisible by 9. (You can repeatedly sum the digits until the sum is small enough to manage easily.)

Divisibility by 11: Alternating sum of digits is divisible by 11. (Almost always turns out to be -11, 0, or 11. Example: 66374. 6 - 6 + 3 - 7 + 4 = 0, so 66374 is divisible by 11.)



Seeing this list of silly things one might find useful in high school math contests made me nostalgic for those days...


They're not that silly actually.

Division is the most 'complicated' of the arithmetic operations and if you rely on doing sums in your head frequently then knowing such shortcuts can speed up the calculations considerably.

It also helps in checking results of other calculations.


I find this kind of things extremely handy in my everyday job. Especially in meetings, since often you are forced to do mental arithmetic to estimate the magnitude of a parameter, etc. Abusing the calculator can put your brain in poor shape, just like muscles!


Seriously? You use divisibility tests to make estimations? I hope nothing much is riding on those estimates...


Silly? Some people do math for a living.


I do math for a living. Needing to now whether a small integer is divisible by 7 rarely comes up. And when it dos we tend to let dumb machines handle the easy stuff, leaving humans free to think.


Those people don't get paid by the hour, so they use a calculator :)


> relatively prime

Do primes come in degrees these days?


I'm not sure if this is humour or not, but "relatively prime" or "coprime" means that the two numbers have GCD 1.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: