There apparently exist divisibility rules for every number, not just 2-10. I don’t know them all, but thankfully, one doesn’t have to. :)
What you can skip
Suppose we’re faced with finding out what numbers evenly divide 923, if any.
Right off we can tell that 2 does not (it’s odd) and neither does 3 (the digits add to 14, which is not divisible by 3).
And we can skip 4 because if it wasn’t divisible by 2, it certainly won’t be divisible by 4.
In fact, we can skip every composite number, because every composite number is a product of primes less than it. (Fundamental theorem of arithmetic)
It’s still useful to know the rules for 4, 6, and 9. Just notice that 6 depends on the rules for both 2 and 3 :)
So when prime factorizing, all we need to test for divisibility is the primes: 2,3,5,7,11,13,17,19, etc.
And if you’re ever unsure about what’s a prime and what isn’t, you can test them by doing the divisibility rules for the primes underneath it! :D
Ex: 39 looks like a prime at first, but a check for 3 shows that it is 3*13.
41, though, is not divisible by 2, 3, 5, or 7, so it’s prime. (Why do we only have to test up to 7? We’ll see later.)
So we should use 41 as a divisor for larger numbers, but we don’t need 39 if we’ve already tested for 3 and 13.
Continuing, 923 does not end in 5 or 0, therefore it is not divisible by 5.
7 is tricky. Here are some methods for it.
But once we start getting into these higher primes, it’s daunting to try and memorize rules for each individual one. But once again, we don’t have to. The process I use works for all primes, and makes use of properties of modular arithmetic and a little creativity.
The rules
One property is that if x is divisible by d (or in shorthand, d|x or “d divides x”) and d also divides y, then d|(x+y). In other words, if two numbers are both divisible by the same number (they are both multiples of d), then their sum will also be divisible by d.
Ex: We know that 36 is divisible by 3. So is 36+3 = 39, 36+30 = 66, 36-12 = 24 and 3000-36 = 2974.
Also, if d|x and n is any integer, then d|(x*n).
Ex: 2 divides 16, so 2 will also divide 16*4 = 64, 16*7 = 112, and 16*100 = 1600.
On the other hand, if x is NOT divisible by d (we’ll say “d!x”), while d|y, then then d!(x+y).
Ex: 24 is not divisible by 5. Neither is 24+5 = 29, 24+25 = 49, 24-10 = 14, or 50-24 = 26.
And if d!x and d!n, then d!(x*n).
Ex: 4 is not divisible by 3. So of 4*10=40, 4*100=400 and 4*1000=4000, none are divisible by 3. 4*24=96 is though, because 3|24.
It can also be shown that if d|(x*y) and d is prime, then d divides either x or y or both.
(Be careful – this does not always work if d is composite. It’s true that 6|210, and that 6|(21*10). But 6 divides neither factor.)
Ex: 13|5252, therefore 13 will always divide at least one of the several ways 5252 can be split into two factors: 2626*2, 1313*4, 404*13, etc. This will be very useful. :D
Back to 923
So 923 is either divisible by 7 or it isn’t.
Whichever one it is, if we stick to those rules of modular arithmetic, we can do all kinds of things to 923 and leave its (in)divisibility intact.
We could start by adding 7 to get 930.
If 7|930, then by the last rule, 7|93. (It doesn’t divide 10, so it must divide 93.)
But does 7|93? Let’s keep going.
Add 7 to 93 and we get 100.
Unfortunately the first dozen or so multiples of 7 skips right over 100. So 100 is not divisible by 7, and so, neither is 923.
The next prime is 11. There’s quite a few easy-to-remember rules for this.
If we try the last-digit one, we see that 92-3 = 89, just a little over 88. So it’s not divisible by 11.
Now let’s try 13. 923-13 = 910. What’s true of 910 in this case is also true of 91, by our last rule.
13, 26, 39, 52, 65, 78, 91! 923 seems to be divisible by 13. A calculator confirms that 923 = 13*71.
So 923 is divisible by both 13 and 71. But are we done? Is 71 prime?
71 is not divisible by 2, 3, 5, or 7, so it is prime. But once again, why can we stop there? Let’s do an experiment.
Laziness justified
1103 is prime. (Pretend we don’t know this.) If we used a calculator to test each divisibility rule, here’s what we would get:
1103 / 2 = 551.5
1103 / 3 = 367.66667
1103 / 5 = 220.6
1103 / 7 = 157.57143
1103 / 11 = 100.27273
…
Eventually the divisor would grow larger than the quotient.
…
1103 / 31 = 35.58065
1103 / 37 = 29.81081
There wouldn’t be much point in testing divisibility any higher than that, because if there was any even division, it would have shown up in the quotient!
So the quitting point, roughly, is where the divisor equals the quotient, the square root. :D
Therefore, when testing any 2-digit number to see whether it is prime, you need only test it for 2,3,5, and 7, as we’ve done above. This is because the square root of any 2-digit number is less than 10.
Even out the ones
Sometimes you’ll come across numbers that work very easily with this process, for example, dividing 4108205 by 41; you can knock out the 4100000 then the 8200 and you’re left with 5. But 99% of the time you’ll have numbers that aren’t so cooperative. But no matter what, you can always knock out at least one digit with each step.
The key thing to note is that all primes (or possible primes) of 2 or more digits end in either 1,3,7 or 9. Take 43891 for example. It’s a possible prime, and to test it we end up using primes.
11: Subtract 11 to get 43880, and divide by 10 to work with 4388
13: Add three times 13 (39) to get 43930, and divide by 10 to work with 4393.
17: Subtract three times 17 (51) to get 43840, and divide by 10 to work with 4384.
19: Add 19 to get 43910, and divide by 10 work with 4391.
It turns out that, for all primes, you can “even out the ones” every time by either adding or subtracting either the prime or triple the prime. You can use 17 to even out any number ending in 1,3,7,9, by subtracting triple 17, adding 17, subtracting 17, and adding triple 17, respectively. There are sixteen combinations in all, try them out.
So let’s see this all in action.
887
900 = 302, so the square root of 887 will be a little under 30. Tests up to 29 should cover it.
Is 887 divisible by:
- 2? no.
- 3? 8 + 8 + 7 = 23; no.
- 5? no.
- 7? 887 – 7 = 880; 880 / 10 = 88; 88 – 77 = 11; no.
- 11? 880 is a multiple of 11, so 887 – 880 = 7, no.
- 13? 887 + 13 = 900; 900 / 100 = 9, no.
- 17? 887 – 17 = 870; 870 / 10 = 87; 87 – 17 = 70; 70 / 10 = 7, no.
- 19? 19*3 = 57; so 887 – 57 = 830; 830 / 10 = 83. Multiples of 19 include 19, 38, 57, 76, 95. Skips over 83, so no.
- 23? 887 + 23 = 910; 910 / 10 = 91; Multiples of 23: 23, 46, 69, 92. Just missed it!
- 29? 29*3 = 87; so 887 – 87 = 800; 800 / 100 = 8; no.
So 887 is prime. It just thinks it’s so special, doesn’t it?
11647
It’s close to 10000, whose square root is 100. Since 1102 = 12100, we need not go past 110. The closest prime under that is 109.
Is 11647 divisible by:
- 2? no.
- 3? 1+1+6+4+7 = 19, no.
- 5? no.
- 7? 11647 – 7 = 11640 -> 1164; 1164 – 14 = 1150 -> 115; 115 – 35 = 80; no.
- 11? 11647 – 11000 = 647; 660 – 647 = 13; no.
- 13? 11647 + 13 = 11660 -> 1166; 1166/11 = 106; 130 – 106 = 24, no.
- 17? 11647 – 17 = 11630 -> 1163; 1163 + 17 = 1180 -> 118; 118 – 17 = 101 which is prime, so no.
- 19? 19*3 = 57; so 11647 – 57 = 11590 -> 1159; 1159 – 19 = 1140 -> 114; 114 – 19 = 95, which is 5*19! :D
Phew, I wasn’t looking forward to getting to the triple digits.
So we’ve found a factor. 11647 / 19 = 613.
But is 613 prime?
Here’s something even cooler: we don’t have to start over to find out! If 613 was divisible by anything from 2-17, we would know by now.
We should start over at the factor we just used, because prime factors can be used more than once.
(And if the factor you just used is greater than the square root of the new number in question, you’re done – you know it’s prime!)
So we’ll start over at 19, and we can go on until… calcy says square root of 613 is 24.7, so 23 is where we stop.
Is 613 divisible by:
- 19? 19*3= 57; so 613 + 57 = 670 -> 67. Multiples 19,38,57,76, nope.
- 23? 613 – 23 = 590 -> 59; Multiples 23,46,69, nope.
So 613 is prime and 11647 is completely factorized into 19 and 613.
For five-figure numbers and greater, I can get to about 47 before I lose patience and just use a calculator.
Like many things in math, this is a good party trick.
If I’ve made any errors, please point them out, and if there’s any parts in particular that you’d like made clearer, say so too. :)
http://en.wikipedia.org/wiki/Fundamental_theorem_of_arithmetic