Over in MPSIMS there’s a thread about quirky stuff people do, and a couple have mentioned math play with license plates, testing for divisibility and so on. It reminded me of a handful of tricks I learned in 7th grade math about how to test if a given number was divisible by a single-digit number. Some were simple, like the tests for 2, 3, or 5, some a little more complex, like 4, 6, or 9. But for the life of me I can’t remember the test of divisibility for 7!
In grade school, we were taught the rule for division by seven was “divide by seven”. For most small numbers that school kids would deal with, this is far easier than either method above (espcially remembering the 132645 sequence)
What I tend to do is find the closest multiple of seven that I can remember and subtract the two, then see if that result is divisible by seven. For example, is 84 divisible by seven? Well, it is close to 70 (easy to remember multiple of seven), so
84 - 70 = 14, and 14 is divisible by seven, so 84 is divisible by seven.
is 168 divisible by seven? Well, 168 is close to 140, so
168 - 140 = 28, and 28 is divisible by seven, so 168 is divisible by seven.
This, of course, would work for every number, not just seven, but most other numbers have quicker methods. Nine is still my favorite in that respect.
Another thing you can do is break up the number in chunks of three digits (starting from the right), then alternately add and subtract the chunks. This works simultaneously for 7, 11, and 13 (71113 = 1001).
For example:
843798543984740
843 798 543 984 740
843 - 798 + 543 - 984 + 740
344
344 has remainders 1, 3, and 6 when divided by 7, 11, and 13, respectively, so our original number 843798543984740 has those same remainders.
11 can be done even quicker in a similar manner, by taking each digit individually rather than in chunks of three:
Another method - which is mentioned in the Talmud (Avodah Zarah 9b), as a way of calculating when the next Sabbatical year occurs - is:
[ol][li]Divide the number by 100[/li][li]Multiply the quotient by 2[/li][li]Add the result to the remainder from step 1[/li][li]If the result is greater than 100, repeat the last three steps[/li][li]If the result is divisible by 7, then so is the original number.[/ol](Obviously, this method is useful only for numbers between 100 and whatever you can comfortably manipulate.)[/li]
Thus, taking 2004 as an example:
I liked the 3-digits-at-a-time method until I read about this one: subtract 7 or a multiple of 7 from every digit or adjacent pair of digits repeatedly until you get down to one digit. That’s the remainder.
Even better, that works for divisibility by any number! Just subtract from the needed number of adjacent digits.