[Math Lair] Divisibility Tests

Math Lair Home > Topics > Divisibility Tests

One interesting way of passing time is to try and figure out whether some large number is divisible by some smaller number (which is another way of saying that the large number is congruent to 0 modulo the smaller number). If you were asked whether 23,586,487,448 is divisible by 3, would you be able to figure it out without using a calculator? It's easy to determine whether it is or not—if you know some shortcuts:

1:
Every number is divisible by 1.
2:
A number is divisible by 2 if it ends in 0, 2, 4, 6, or 8.
3:
A number is divisible by 3 if its digits sum to a multiple of 3. For example, 284,691 is divisible by 3 because its digits sum to 2 + 8 + 4 + 6 + 9 + 1 = 30, and 30 is a multiple of 3.
4:
A number is divisible by 4 if its last two digits are divisible by 4. So, 35,196 is divisible by 4 because 96 is divisible by 4. Another way of looking at it is that a number is divisible by 4 if either (a) the tens digit is even and the ones digit is 0, 4, or 8, or (b) the tens digit is odd and the ones digit is 2 or 6.
5:
A number is divisible by 5 if its last digit is either a 5 or a zero.
6:
To figure out whether a number is divisible by 6, combine the tests for 2 and 3. That is, if the number ends in 0, 2, 4, 6, or 8, and its digits sum to a multiple of 3, then it is divisible by 6.
7:
This one is a little trickier. First, evaluate 1 × the digit in the ones place + 3 × the digit in the tens place + 2 × the digit in the hundreds place − 1 × the digit in the thousands place − 3 × the digit in the ten thousands place − 2 × the digit in the hundred thousands place + 1 × the digit in the millions place + 3 × the digit in the ten millions place ... . If this number is divisible by seven, so is the original number. As an example, take the number 108,402. 1×2 + 2×4 − 1×8 − 2×1 = 0, which is divisible by 7, so 108,402 is divisible by 7. In fact it is 7 × 15,486, if you have a calculator handy. See how to discover such divisibility tests.
8:
This isn't too easy either. 1000 is divisible by eight, so to determine whether a number is divisible by 8 we can check whether the last three digits are divisible by 8. This isn't always easy so we can simplify the process slightly as follows:
9:
A number is divisible by 9 if its digits sum to a multiple of 9. See also digital roots.
10:
A number is divisible by 10 if its last digit is 0.
11:
Start by evaluating ones digit − tens digit + hundreds digit − thousands digit, and continue to add and subtract alternate digits. If this sum is divisible by 11, so is the original number.
12:
To check if a number is divisible by 12, combine the tests for 3 and 4. That is, if a number's last two digits are a multiple of 4, and all of the digits sum to a multiple of 3, the number is divisible by 12.
13
This is a tricky one, like 7. Evaluate 1 × the digit in the ones place − 3 × the digit in the tens place − 4 × the digit in the hundreds place − 1 × the digit in the thousands place + 3 × the digit in the ten thousands place + 4 × the digit in the hundred thousands place + 1 × the digit in the millions place − 3 × the digit in the ten millions place ... . If this number is divisible by thirteen, so is the original number.
14
Combine the tests for 2 and 7.
15
Combine the tests for 3 and 5. In other words, if the number ends in 0 or 5, and its digits sum to a multiple of 3, it is divisible by 15.

If you have a test for divisibility for any two numbers m and n, and m and n have no factors in common (in other words, they are relatively prime), then you can combine the tests to create a test for m × n. For an example of this, see 6, 12, 14, and 15. Try to think of tests for divisibility by 18, 20, 21, and 22.

You may have noticed some other patterns in the list. Numbers whose only prime factors are 2 or 5 have a divisibility test that involves checking the last couple of digits. For example, a number is divisible by 2 n if its last n digits are. The divisibility test for numbers that are powers of 3 (e.g. 3 and 9) involves summing the digits. You may want to think about why.

The smallest number divisible by every number between 2 and 12 is 27,720, so try this number out to see whether you can get all of the tests to work. On the other hand, 27,733 isn't divisible by any of these numbers, so you may want to try that number too. If you want to try all of the tests from 2 to 15, try the number 360,360 (divisible by all of the numbers from 2–15) and 360,377 (not divisible by any of the numbers from 2–15).

You may have noticed how complex the divisibility test for 7 is. View some other divisibility tests for 7 and other prime numbers.

See how divisibility tests can help to solve a classic problem.

If you like shortcuts, check out my page of calculation shortcuts.