# What are are the tests of divisibility of various numbers?

Feb 14, 2016

There are many divisibility tests. Here are a few, along with how they can be derived.

• An integer is divisible by $2$ if the final digit is even.

• An integer is divisible by $3$ if the sum of its digits is divisible by 3.

• An integer is divisible by $4$ if the integer formed by the last two digits is divisible by 4.

• An integer is divisible by $5$ if the final digit is 5 or 0.

• An integer is divisible by $6$ if it is divisible by 2 and by 3.

• An integer is divisible by $7$ if subtracting twice the last digit from the integer formed by removing the last digit is a multiple of 7.

• An integer is divisible by $8$ if the integer formed by the last three digits is divisible by 8 (this can be made easier by noting that the rule is the same as for 4s if the hundreds digit is even, and the opposite otherwise)

• An integer is divisible by $9$ if the sum of the digits is divisible by 9.

• An integer is divisible by $10$ if the last digit is $0$

For these and more, take a look at the wikipedia page for divisibility rules .

Now, one may wonder about how to come up with these rules, or at least show that they actually will work. One way to do this is with a type of math called modular arithmetic .

In modular arithmetic, we pick an integer $n$ as the modulus and then treat every other integer as being congruent modulo $n$ to its remainder when divided by $n$. An easy way to think about this is that you can add or subtract $n$ without changing the value of an integer modulo n. This is the same as how, on an analog clock, adding twelve hours results in the same time. Adding hours on a clock is addition modulo $12$.

What makes modular arithmetic very useful in determining divisibility rules is that for any integer $a$ and positive integer $b$, we can say that $a$ is divisible by $b$ if and only if

$a \equiv 0 \text{ (mod b)}$ ($a$ is congruent to $0$ modulo $b$).

Let's use this to see why the divisibility rule for $3$ works. We'll do so using an example which should show the general concept. In this example, we'll see why $53412$ is divisible by $3$. Remember that adding or subtracting $3$ will not change the value of an integer modulo $3$.

$53412$ is divisible by $3$ if and only if $53412 \equiv 0 \text{ (mod 3)}$

But also, because $10 - 3 - 3 - 3 = 1$, we have $10 \equiv 1 \text{ (mod 3)}$

Thus:
$53412 \equiv 5 \cdot {10}^{5} + 3 \cdot {10}^{4} + 4 \cdot {10}^{3} + 1 \cdot {10}^{2} + 2 \text{ (mod 3)}$

$\equiv 5 \cdot {1}^{5} + 3 \cdot {1}^{4} + 4 \cdot {1}^{3} + 1 \cdot {1}^{2} + 2 \text{ (mod 3)}$

$\textcolor{red}{\equiv 5 + 3 + 4 + 1 + 2 \text{ (mod 3)}}$

$\equiv 3 \cdot 5 \text{ (mod 3)}$

$\equiv 0 \cdot 5 \text{ (mod 3)}$

$\equiv 0 \text{ (mod 3)}$

Thus $53412$ is divisible by $3$. The step in red demonstrates why we can simply sum the digits and check that instead of trying to divide the original number by $3$.