

In reading a popular math book, I came across several arithmetic factoring tricks. Essentially, if the last digit of a number is zero, then the entire number is divisible by 10. If the last number is even, then the entire number is divisible by 2. If the last two digits are divisible by 4, then the whole number is. If the last three digits divide by 8, then the whole number does. If the last four digits divide by 16, then the whole number does, etc. If the last digit is 5, then the whole number divides by 5.Now for the tricky ones.
If you add the digits in a number and the sum is divisible by 3, then the whole number is.
Similarly, if you add the digits in a number and the sum is divisible by 9, then the whole number is. For example, take the number 1233:
1 + 2 + 3 + 3 = 9. Therefore, the whole number is divisible by 9 and the quotient is 137. The number is also divisible by 3 and the quotient is 411. It works for extremely large numbers too (I checked on my calculator).Now here's a really tricky trick. You add up the alternate digits of a number and then add up the other set of alternate digits. If the sums of the alternate digits equal each other then the whole number is divisible by 11. Also, if the difference of the alternate digits is 11 or a multiple of 11, then the whole number is divisible by 11. For example, 123,456,322.
1 + 3 + 5 + 3 + 2 = 14 and2 + 4 + 6 + 2 = 14. Therefore, the whole number is divisible by 11 and the quotient is 11,223,302.Also, if a number is divisible by both 3 and 2, then the whole number is divisible by 6.
The only single digit number for which there is no trick listed is 7.
I find these rules interesting and useful, especially when factoring large numbers in algebraic expressions. However, I'm not sure why all these rules work. Can you explain to me why these math tricks work? If I could understand why they work, I think it would improve my math skills. Thanks in advance for your help.
Cindy Smith
cms@dragon.com
Thank you for this long and very well-written question. I will try to write as clearly as you as I answer.- Doctor Rob, The Math Forum dr.math@forum.swarthmore.eduAll these digital tests for divisibility are based on the fact that our system of numerals is written using the base of 10.
The digits in a string of digits making up a numeral are actually the coefficients of a polynomial with 10 substituted for the variable. For example,
1233 = 1*10^3 + 2*10^2 + 3*10^1 + 3*10^0
which is gotten from the polynomial
1*x^3 + 2*x^2 + 3*x^1 + 3*x^0 = x^3 + 2*x^2 + 3*x + 3
by substituting 10 for x. We can explain each of these tricks in terms of that fact:
10 - numerals ending in 0 represent numbers divisible by 10:
Since the last digit is zero, and all other terms in the polynomial form are divisible by 10, the number is divisible by 10. Similarly, if the number is divisible by 10, since all the terms except the last one are automatically divisible by 10 no matter what the coefficients or digits are, the number will be divisible by 10 only if the last digit is. Since all the digits are smaller than 10, the last digit has to be 0 to be a multiple of 10.
2 - numerals ending in an even digit represent numbers divisible by 2:
Same argument as above about all the terms except the last one being divisible by 2. The last digit is divisible by 2 (even) if and only if the whole number is.
4 - numerals ending with a two-digit multiple of 4 represent numbers divisible by 4:
Similar to the above, but since 10 is not a multiple of 4, but 10^2 is, we have to look at the last two digits instead of just the last digit.
8 - numerals ending with a three-digit multiple of 8 represent numbers divisible by 8:
Similar to 4, but now 10^2 is not a multiple of 8, but 10^3 is, so we have to look at the last three digits.
16 - You figure this one!
5 - You figure this one, too!
3 - numerals whose sum of digits is divisible by 3 represent numbers divisible by 3:
This one is different, because 3 does not divide any power of 10 evenly. That means we will have to consider the effect of all the digits. Here we use this fact:
10^k - 1 = (10 - 1)*(10^(k-1) = ... + 10^2 + 10 + 1)
This is a fancy way of saying 9999...999 = 9*1111...111. We use this to rewrite our powers of 10 as
10^k = 9*a[k] + 1. Now the polynomial form of a numeral looks like this:d[k]*10^k + d[k-1]*10^(k-1) + ... + d[1]*10 + d[0]
= d[k]*(9*a[k] + 1) + ... + d[1]*(9*a[1] + 1) + d[0]
= 9*(d[k]*a[k] + ... + d[1]*a[1]) + d[k] + ... + d[1] + d[0]Now notice that 3 divides the first part, so the whole number is divisible by 3 if and only if the sum of the digits is.
9 - numerals whose sum of digits is divisible by 9 represent numbers divisible by 9:
Use the same equation as the previous case. You figure the rest!
11 - numerals whose alternating sum of digits is divisible by 11 represent numbers divisible by 11:
Here the phrase "alternating sum" means we alternate the signs from positive to negative to positive to negative, and so on. We use this fact: 10 to an odd power plus 1 is divisible by 11, and 10 to an even power minus 1 is divisible by 11.
The first part is a fancy way of writing
10000...0001 =11*9090...9091 (where there are an even number of 0's on the left-hand side).The second part is a fancy way of writing
99999...9999 =11*9090...0909 (where there are an even number of 9's in the left-hand side). We write
10^(2*k) = 11*b[2*k] + 1 and
10^(2*k+1) = 11*b[2*k+1] - 1.
Here k is any nonnegative integer. We substitute that into the polynomial form, so:d[2*k]*10^(2*k) + d[2*k-1]*10^(2*k-1) + ... + d[1]*10 + d[0]
= d[2*k]*(11*b[2*k] + 1) + d[2*k-1]*(11*b[2*k-1] - 1) + ...
+ d[1]*(11*a[1] - 1) + d[0]
= 11*(d[2*k]*b[2*k] + ... + d[1]*a[1]) + d[2*k] - d[2*k-1]
+ ... - d[1] + d[0]The first part is divisible by 11 no matter what the digits are, so the whole number is divisible by 11 if and only if the last part, which is the alternating sum of the digits, is divisible by 11. If you prefer, you can write
d[2*k] - d[2*k-1] + ... - d[1] + d[0] =
(d[0] + d[2] + ... + d[2*k]) - (d[1] + d[3] + ... + d[2*k-1]),so that you add up every other digit, starting from the units digit, and then add up the remaining digits, and subtract the two sums. This will compute the same result as the alternating sum of the digits.
7 - There is a trick for 7 which is not as well known as the others. It makes use of the fact that
10^(6*k) - 1 is divisible by 7, and10^(6*k - 3) + 1 is divisible by 7. It goes like this:Mark off the digits in groups of threes, just as you do when you put commas in large numbers. Starting from the right, compute the alternating sum of the groups as three-digit numbers. If the result is negative, ignore the sign. If the result is greater than 1000, do the same thing to the resulting number until you have a result between 0 and 1000 inclusive. That 3-digit number is divisible by 7 if and only if the original number is too.
Example:
123471023473 = 123,471,023,473, so make the sum
473 - 23 + 471 - 123 = 450 + 348 = 798.
798 = 7*114, so 798 is divisible by 7, and 123471023472 is, too.An extra trick is to replace every digit of 7 by a 0, every 8 by a 1, and every 9 by a 2, before, during, or after the sum, and the fact remains. The sum could also have been computed as
473 - 23 + 471 - 123
--> 403 - 23 + 401 - 123 = 380 + 278
--> 310 + 201 = 511 = 7*73.
You can figure out why this "casting out 7's" part works.There is another way of testing for 7 which uses the fact that 7 divides
2*10 + 1 = 21. Start with the numeral for the number you want to test. Chop off the last digit, double it, and subtract that from the rest of the number. Continue this until you get stuck. The result is 7, 0, or -7, if and only if the original number is a multiple of 7.Example:
123471023473
--> 12347102347 - 2*3 = 12347102341
--> 1234710234 - 2*1 = 1234710232
--> 123471023 - 2*2 = 123471019
--> 12347101 - 2*9 = 12347083
--> 1234708 - 2*3 = 1234702
--> 123470 - 2*2 = 123466
--> 12346 - 2*6 = 12334
--> 1233 - 2*4 = 1225
--> 122 - 2*5 = 112
--> 11 - 2*2 = 7.
13 - The same trick that works for 7 works for 13; that is, 13 divides
10^(6*k) - 1 and10^(6*k - 3) + 1, so the alternating sum of three-digit groups works here, too.
17 - This is harder. You would have to use alternating sums of 8-digit groups!