recent squawks budgie's friends' journals calendar all about budgie hypotheticals Previous Previous Next Next
budgie's squawks - Geeky maths stuff - divisible by 7?
online random ravings
budgie_uk
[info]budgie_uk
Add to Memories
Tell a Friend
Geeky maths stuff - divisible by 7?
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.
Comments
izzytart From: [info]izzytart Date: January 20th, 2005 06:11 pm (UTC) (Link)
As I have always been *really* *really* bad at math, I actually find those sorts of things facinating. Now I just have to remember it ...

but it's COOL!
budgie_uk From: [info]budgie_uk Date: January 20th, 2005 06:14 pm (UTC) (Link)
Laura is the same way; says she's absolutely lousy at math(s). I maintain that the basics of math(s), including tricks like the ones above, can be taught to anyone.

If you don't understand maths, I'm convinced that you had a lousy maths teacher.
niall_ From: [info]niall_ Date: January 20th, 2005 07:19 pm (UTC) (Link)
I didn't have all of those tricks taught, but I can see how many make sense (4, for example - it rolls over at 100, so the last two digits only makes sense). Wish I had known about the rest earlier, though.

Love stuff like this...
budgie_uk From: [info]budgie_uk Date: January 22nd, 2005 08:31 am (UTC) (Link)
Glad you enjoyed it, Niall...
From: [info]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)
budgie_uk From: [info]budgie_uk Date: January 22nd, 2005 10:07 am (UTC) (Link)

Re: The mathematical reasons

I appreciate the long and detailed reply, seriously...

By the way, how'd you come across my livejournal? Always fascinated to find out how someone discovers my ramblings...
From: [info]jrr7 Date: January 22nd, 2005 07:34 pm (UTC) (Link)

Re: The mathematical reasons

I was searching for something with Google, I think it was a phrase that's common in spam, "Get a HTML emailer", to see if anyone else had written an article about it. I found someone writing about it on his blog. He was syndicating blog links from a "Geeky stuff" blog and I clicked to go that blog. On that blog I saw the link to your post about numbers divisibility and I said "I wonder if he knows the trick for divisibility by 7" so I followed it.

Fortunately I had signed up for lj so I could argue with a webcartoonist about politics (which I probably won't do again), i just needed to be reminded about my password.
budgie_uk From: [info]budgie_uk Date: January 23rd, 2005 06:03 am (UTC) (Link)

Re: The mathematical reasons

Thanks - always nice to know the path by which someone stumbles across the blog.

Hope you found what you were looking for...

aberbotimue From: [info]aberbotimue Date: January 21st, 2005 08:38 am (UTC) (Link)
i'm suoposed to be good at these thinks, and I found that lot so helpful...

these alone are brillian.. thank you so much for sharing...
budgie_uk From: [info]budgie_uk Date: January 22nd, 2005 10:23 am (UTC) (Link)
My pleasure.

It's surprised me (though it's a delightful surprise) just how many new-to-me people have responded or emailed me on this...

I'm quite unsure how people have come across it, but as I say, it's a delightful surprise.
aberbotimue From: [info]aberbotimue Date: January 22nd, 2005 12:22 pm (UTC) (Link)
from your bio...

Also Friend of: 15: andrewducker, apiphile, dinoblack, indymag, jancolls

i got it from a post by the first on the list.. he is the centre of the universe, everyuthing comes from our MR ducker
budgie_uk From: [info]budgie_uk Date: January 22nd, 2005 12:23 pm (UTC) (Link)
Ah, yes, that would explain it. Cheers.
bohemiancoast From: [info]bohemiancoast Date: January 21st, 2005 09:53 am (UTC) (Link)
The trick for 7s is excellent (for numbers of a certain size -- once you're applying it more than about twice, it's debatable whether it's easier than dividing by 7). It works because lopping off the last digit and subtracting twice that from the remaining digits is a friendly way of saying 'subtract 21 times the last digit from the number and then divide by 10'.

Subtracting multiples of 21 doesn't change divisibility by 7, and leaves you with a multiple of 10; and clearly taking a factor of 10 (=2x5) out of a number doesn't change divisibility by 7.
budgie_uk From: [info]budgie_uk Date: January 22nd, 2005 10:15 am (UTC) (Link)
Ah, so that's how it works. OK, that makes sense.

So, how did you come across this post? I don't think you're a regular reader of the blog, are you?
bohemiancoast From: [info]bohemiancoast Date: January 22nd, 2005 03:50 pm (UTC) (Link)
It was probably linked from another journal I do read...
budgie_uk From: [info]budgie_uk Date: January 23rd, 2005 06:05 am (UTC) (Link)
Ah, quite probably!
andrewducker From: [info]andrewducker Date: January 21st, 2005 10:39 am (UTC) (Link)
This is a method to find out whether any number is divisible by any other...
http://mathforum.org/library/drmath/view/58516.html
budgie_uk From: [info]budgie_uk Date: January 22nd, 2005 08:31 am (UTC) (Link)
Wrong link, Andrew - that just takes you to the "7" rule...
andrewducker From: [info]andrewducker Date: January 22nd, 2005 10:45 am (UTC) (Link)
Read the second half, which shows you a simpler technique that works for any number...
budgie_uk From: [info]budgie_uk Date: January 22nd, 2005 10:45 am (UTC) (Link)
OK - will do... cheers.
From: [info]jrr7 Date: January 27th, 2005 06:45 am (UTC) (Link)

Here's another one

http://digicc.com/fido/

To figure out how this works, think mod 9.

Hint: Does shuffling a number's digits change its remainder when divided by 9?
budgie_uk From: [info]budgie_uk Date: January 27th, 2005 07:04 am (UTC) (Link)

Re: Here's another one

Thanks - that one I knew about some time ago.

Was offered http://www.dslextreme.com/users/exstatica/psychic.swf as something similar.
From: (Anonymous) Date: May 19th, 2005 02:03 am (UTC) (Link)

divisibility by 7

Hardly boring. I teach public school 4th grade "high math" to the little mensa children of the grade level and tomorrow is the last day of math; Friday is last-day-of-school-party day so nobody will be teaching a thing. I told them a long time ago I would show them divisibility by 7 and they will positively eat it up tomorrow. I know they will. One of them even skipped a grade so he is a year younger than anyone else but more scathingly brilliant than the rest of them. One feels smarter just being in the same room with these kids; it is so great. Math does rock in elementary school...
23 squawks in response or squawk at me
about budgie
Lee "Budgie" Barnett
User: [info]budgie_uk
Name: Lee "Budgie" Barnett
Website: hypotheticals
budgie's days
Back July 2009
1234
567891011
12131415161718
19202122232425
262728293031
budgie's links