 |

 |
budgie_uk | |
 |
 |
 |
 |
|
 |
 |
Skip this if you're not fascinated by numbers. I'm serious - this subject has been known to have a more soporific effect than laudanum. OK, still with me? I had a great maths teacher at school. He understood that to get kids interested in maths as a subject, he had to make it interesting as a subject. And to that end, he taught his class what he called the 'tricks of the trade'. So, for example, he taught us how to discover whether any number was divisible by any number between 2 and 12. It remains a mystery to me how everyone doesn't know this, but: 2: duh, the number's even 3: if the number's digits sum to a number divisible by 3, the number itself is divisible by 3. 4: If the last two digits of the number are divisible by 4, the whole number is. 5: the number ends in 5 or 0. 6: if the number's even and the number's digits sum to a number divisible by 3, the number itself is divisible by 6. 7: hmm, he didn't teach us this one. 8: If the last three digits of the number are divisible by 8, the whole number is. 9: if the number's digits sum to a number divisible by 9, the number itself is divisible by 9. 10: the number ends in a 0. 11. If the sum of every other digit, starting with the first, is either equal to the sum of every other digit starting with the second, or the difference is exactly divisible by 11, then the number is evenly divisible by 11. Try 13,057. 1+0+7 = 3+5, therefore it should divide evenly by 11. And indeed it does: 13,057 ÷ 11 = 1,187. Take 92,807. (9+8+7) - (2+0) = 22, therefore it should divide evenly by 11. And it does: 92,807 ÷ 11 = 8,437. 12: if the number's digits sum to a number divisible by 3, and the last two digits of the number are divisible by 4, the whole number is exactly divisible by 12. Except... he didn't teach us how to quickly find if a number was divisible by seven. I even told Philip, when teaching him those same tricks, that there wasn't a quick way. Well, I was wrong, and it's taken me until the age of 40 to discover an incredibly easy way... I have no idea why it works, but it does. Take the number's final digit and double it. Subtract that from the rest of the digits and if you end up with a number divisible by 7, you're home and dry. Take the number 364. Double the final digit and you get 8. Subtract that from the first two digits: 36 - 8 = 28. And what do you know? 28 is divisible by 7, so 364 is exactly divisible by 7. 903? 90 minus 6 (3 doubled) = 84, so 903 is divisible by 7. Look, I told you it was boring; don't say I didn't warn you. Be grateful, I could have taught you a quick way of working out the two-digit cube root of any number between 1,000 and 970,299.
|
 |
 |
 |
 |
|
 |
 |



 |
 |
 |
 |
 |
 |
From: jrr7 |
Date: January 21st, 2005 08:18 am (UTC) |
| (Link) |
The mathematical reasons
|
All of these tricks are based on "modulo arithmetic", a branch of mathematics you use every day without realizing it. Modulo arithmetic asks the question "What if, when you were counting, numbers instead of increasing forever, stopped at some point and went back to the start, repeating endlessly?" The most familiar example is the clock: When you get to 12, it starts over at 1. When you're adding a interval to a time, if you get an hour over 12, you have to subtract 12 until the number is 12 or lower. Similarly with minutes/seconds and 60 (except in this case 0 is allowed and 60 is not). Of course mathematicians being who they are, they almost always start at 0 instead of 1 (think military time which runs from 0 00 to 23 59). If you do this you can just divide by the "modulus" (the number that can't be reached), throw away the quotient, and keep the remainder. Examples: 8 + 12 mod 6 = 20 mod 6 = 2. 7 * 16 mod 8 = 112 mod 8 = 0.
Note from the last example that (a * b) mod b is always 0, for any integer a and b. So this is a quick way to tell whether one number is divisible by another. All of the shortcuts for divisibility by n are based on simplifying the equation a + 10*b + 100*c + 1000*d + ... mod n =
where a is the ones digit, b is the tens digit, c is the hundreds digit, and so forth. - 2: All the terms with a "10" in them drop out, since 10 is a multiple of 2. This leaves us with
a mod 2, and it's easy to check the evenness of a single digit.
- 3: note that 10=1+9 and so forth, so the equation becomes
a + (1+9)*b + (1+99)*c + ... mod 3 = a + b + 9*b + c + 99*c + ... mod 3 =
Since 9, 99, 999 are multiples of 3, all these terms drop out, leaving a + b + c + ... mod 3
- 4: 100 and all higher powers of 10 are multiples of 4 (or you can write
a + 10*b + 100*(c + 10*d + ...) and get rid of all the terms with one fell swoop). If you're too lazy to remember what the two-digit multiples of 4 are, well let's see:
a + 10*b mod 4 = a + 8*b + 2*b mod 4 = a + 2*b mod 4
In other words, the number ...edcba has the same divisibilty by 4 as does (a + 2*b). Double the tens digit and add it to the ones digit. 64 -> 12 + 4 -> 16
- 5: easy
- 6: The method Budgie posted, using the tests for 2 and 3, is way quicker than using the "real" test for 6.
- 7: Note that doubling a number does not change its divisibility by 7, and neither does negating it. So let's check the divisibility-by-7 of:
-2*a - 20*b - 200*c - 2000*d + ... mod 7 = -2*a - 20*(b + 10*c + 100*d + ...) mod 7 =(just algebra)
-2*a - (-1)*(b + 10*c + 100*d + ...) mod 7 =(I separated 20 into 21 - 1)
-2*a + b + 10*c + 100*d + ... mod 7 (negative times negative equals positive)
So there you go: take the last digit ("a"), double it, and subtract it from the number formed by cutting off the last digit (...edcb).
If your number still has too many digits, you can repeat the process (just like with 3 and 9)
- 8: If you can't memorize all the 3-digit multiples of 8 (I can't) you can use this trick:
a + 10*b + 100*c + 1000*d + ... mod 8 = a + 2*b + 4*c mod 8 Double the tens digit, quadruple the hundreds digit, add both of them to the ones digit.
- 9: this one's easy since 10 = 9 + 1
- 11: this one is also easy since 10 = 11 - 1 (the -1 keeps being multiplied by itself which is why you alternate digits)
|
 |
 |
 |
 |
|

 |
|
|  |
 |


|
 |
|
 |