Showing posts with label Mathematics. Show all posts
Showing posts with label Mathematics. Show all posts

Friday, December 13, 2013

Division by seven

So first up a justification for why I would want to write about dividing by seven. The short answer is that dividing by any of one through six is pretty trivial. Dividing by two ,three, four, five or six is straight forward primary school mathematics.  Dividing by one is appropriate for (insert group you’d like to insult here).  Seven is the first interesting case.  Long answer: Read the rest of this post and hopefully you’ll see.  Advertising answer: It’s fun to be able to rattle off 20 or 30 digits easily (also cheap and obnoxious but still fun), in front of people who don’t know how to do this.
Long ago in the dim reaches of grade five or so (in my case it was still called standard three) we learned short division.  For those of you who don’t remember grade five (or haven’t gotten there yet). I’ll outline how this works below. Suppose I want to divide 629 by 4. (Obviously skip this if know it).
Start out by writing



I can’t divide this all in my head but I do know that 4 goes into the first digit (6 in this case)  once and leaves a remainder of 2. So I write.




The next step is noticing that 4 goes into  22, five times and leaves a remainder of 2. So I write



Repeating this procedure a few more times (and adding in some zeros after the decimal point) gives us.

Which is to say that 629 divided by 4 is 157.25.

The refresher out of the way let’s try to divide 1 by 7. Start here.



Now fill in some of the rest of it (actually do it if you haven’t).
You’ll get this after 6 iterations.


From here we notice, that we’re pretty much where we started.
We have to divide 10 by 7 in both of the previous 2 pictures and we have an infinite string of 0s in front of us. So we’re going to get the same thing over and over and over again!!!

So 1/7=0.14285714285714285714285714…….
Just remember those six digits in order (less than a phone number and you remember yours) and you can pull off the trick of dividing one by seven.
It gets better though. Dividing two by seven is just as easy, in fact we have already done it!!
How you ask. Well start here



We’ve been here before? Dividing 20 by seven. We get the SAME repeating decimal with a different start point (not to beat anyone over the head with anything but yeah,3/7, 4/7,5/7 and 6/7 work the same way).
i.e.
2/7=0.2857142857…
3/7=0.42857142857….
4/7=0.57142857….
5/7=0.71428571428571....
6/7=0.85714285714…..

All you need to do is remember your start point (and the 6 digit string 142857) and you can divide by 7.
 
If you want to divide say 27 by 7 then. 27/7=3 remainder 6 so 3.857142857…..
This a pretty neat trick but even better there really isn’t anything special about 7. Provided we're willing to learna 16 digit string we can do division by 17. Division by 13 requires learing two 6 digit strings

This works for every positive integer which doesn’t have 2 or 5 as a factor (why 2 and 5 because they are 10s prime factors  and we're using base 10, yes this also works in every other base for exactly the same reasons). 

For example consider dividing 1 by 349. There are only 348 possible things to carry over when dividing 1 by 349  so when I go through the procedure of short division I’m guaranteed to get back to 1 (the first thing I carry) in at most 348 steps and things will repeat.  The period might not be 348 but it won’t be more.  For example the next 2 “interest numbers”  to divide by in base 10 are 13 and 17.
1/17=0.05882352941176470588235294….
This is of length 16 and provided you can remember where to start you can figure out k/17 for pretty much any integer k. On the other hand
1/13=0.0769230769230769230… has period 6. So it only gets half of the the k/13s you could wish for.
2/13=0.153846153846…. also has period 6 and gets us the other half.
So when do we get everything from just 1 cycle??? The answer comes oddly enough from geometric series.


To see this we'll consider some examples.
1/7=0.142857142857142857….=
142857[(10^-6)+(10^-6)^2+(10^-6)^3+(10^-6)^4+….]=
142857*(1/999999)
Giving us 7*142857=999999.
Same thing goes through with 13. What this means is that
i.e. 13*076923=999999
The only way to have a period of length (a factor of) 6 is to be divisible by 10^6-1.

Clearly 17 does divide 10^16 - 1 but none of 10^8 - 1, 10^4 - 1, 10^2 - 1 and 10^1 - 1. So it’s period is actually 16.
There are other ways to think about this and it’s quite abit of fun to do so. But this post is getting long so I’ll stop here.