# Divisibility Tests

##### Age 11 to 16

Published 1997 Revised 2021

As you go along, you can use the interactivity in Dozens to test your understanding of the different divisibility rules.

In this article 'number' will always mean 'positive whole number'.

### Multiples of 2 and 5

The easiest divisibility tests are for $2$ and $5$.
A number is divisible by $2$ if its last digit is even, and by $5$ if its last digit is $0$ or $5$.

Click to read why these tests work.

These tests refer to 'digits' in the (usual) base $10$ representation of the number, so that (for example) $2645$ represents the number $(2\times 1000)+(6\times 100)+(4\times 10)+(5\times 1)$.

Every number is (a multiple of $10$) + (last digit). For example, $2645 = 264\times10+5$

So every number is (a multiple of $2$ and $5$) + (last digit).

If the last digit is a multiple of $2$ (or $5$), then the whole number must be.

### Multiples of 4 and 8

A number is divisible by $4$ if the number represented by its last two digits is a multiple of $4$, and it is a divisible by $8$ if the number represented by its last three digits is a multiple of $8$.

Click to read why these tests work.

This is similar to the tests for divisibility by $2$ and $5.$

Every number is (a multiple of $100$) + (last two digits).

Since $100= 4\times25$, every number is (a multiple of $4$) + (last two digits). So if the last two digits make a number that is a multiple of $4,$ then the whole number must be a multiple of $4.$

For example, $2646 = 100 \times26 + 46 =$ a multiple of $4 + 46.$
$46$ isn't a multiple of $4,$ so $2646$ isn't either.

Every number is (a multiple of $1000$) + (last three digits).

Since $1000= 8\times125$, every number is (a multiple of $8$) + (last three digits). This means that the whole number is divisible by $8$ if the last three digits represent a number that is divisible by $8.$

For example, $62432 = 1000 \times62 + 432 =$ a multiple of $8 + 432.$
$432$ is a multiple of $8,$ so $62432$ is as well.

Note: The last three digits can represent a large number, like $928.$ You can use your knowledge of the $8$ times table and split up large numbers to see whether they are multiples of $8.$ For example, $928 = 800 + 128 = 800 + 64 + 64$ so $928$ is a multiple of $8.$

### Multiples of 3 and 9

A number is divisible by $3,$ or $9,$ if the sum of its digits is divisible by $3$ or $9.$

For example, $89474$ is divisible by $3$ if $8+9+4+7+4 = 32$ is divisible by $3,$ (which is divisible by $3$ if $3+2=5$ is divisible by $3).$ Since it's not, $89474$ is not divisible by $3.$

Click to read why these tests work.

$10$ is $9 + 1$ = (a multiple of $3$) + $1$
So $20$ is $(2\times 9) + 2$ = (a multiple of $3$) + $2$
$30$ is $(3\times 9) + 3$ = (a multiple of $3$) + $3$...
... and $80$ is $(8\times 9) + 8$ = (a multiple of $3$) + $8$...

... and so $81$ = (a multiple of $3$) $+ 8 + 1$
and so if $8 + 1$ = a multiple of $3$, $81$ is a multiple of $3$

and $82$ = (a multiple of $3$) $+ 8 + 2$
and so if $8 + 2$ = a multiple of $3$, $82$ is a multiple of $3$

and $86$ = (a multiple of $3$) $+ 8 + 6$
and so if $8 + 6$ = a multiple of $3$, $86$ is a multiple of $3$

For $257$, we note that $100$ is $99 + 1$, so $200=(2\times 99)+2$ = (a multiple of $3$) + $2$

Therefore $257=(($a multiple of $3)+2)+(($a multiple of $3)+5)+7 = ($a multiple of $3) + 2 + 5 + 7$

Once again, $257$ is a multiple of 3 if and only if the sum of its digits is a multiple of $3$. Since $2 + 5 + 7$ is not a multiple of $3$, neither is $257$.

In general, $10=9+1$, $100=99+1$, $1000=999+1$ and so on, so every 'power' of $10$ (like $10$, $100$, $1000$, $10000$ and so on) is just $1$ more than a multiple of $3$. This means the test can be applied to a number with any number of digits.

Because $10=9+1$, $100=99+1$, $1000=999+1$ and so on, we can see that every power of $10$ is just $1$ more than a multiple of $9$, and so this method for divisibility by $3$ works for $9$ too.

### Multiples of 6, 12 and other composite (non-prime) numbers

A number is divisible by $6$ if and only if it is divisible by both $2$ and $3$. It is divisible by $12$ if and only if it is divisible by both $3$ and $4$.

Click to read why these tests work and to find out about tests for other composite numbers.

Every number can be written as the product of its prime factors, for example:
$6 = 2\times3$
$12 = 2^2\times3$
$120 = 2^3\times3\times5$

So every number that is a multiple of $2$ AND $3$ must be a mutliple $6$
e.g. $150$ is a multiple of $2$ and of $3$ so it must be a multiple of $6$
$150 = 2\times3\times5^2 = 6\times5^2$

And every number that is a multiple of $2^2$ AND $3$ must be a multiple of $12$
e.g. $156$ is a multiple of $2^2$ and of $3$ so it must be a multiple of $12$
$156 = 2^2\times3\times13 = 12\times13$

And every number that is a multiple of $2^3$ AND $3$ AND $5$ must be a multiple of $120$
e.g. $600$ is a multiple of $2^3$ and $3$ and $5$ so it must be a multiple of $120$
$600 =2^3\times3\times5^2 = 120\times5$

For any number $n$:
-  find the prime factorisation of $n$, so $n$ is expressed as the product of prime numbers, i.e. $n=p_1^{a_1}\times p_2^{a_2} \times ... \times p_k^{a_k}$
-  if a number is a multiple of $p_1^{a_1}$ AND $p_2^{a_2}$ AND ...  AND  $p_k^{a_k}$, then the number must also be a multiple of $n$

### Multiples of 11

To determine whether a number is a multiple of $11$, take the ones/units digit, then subtract the tens digit, add the hundreds digit, subtract the thousands digit, and so on until you've added or subtracted all of the digits. If the result is a multiple of $11,$ then so is the original number.

Click to see how this test works.

Whereas every power of $10$ is $1$ more than a multiple of $3$ (or $9$), an alternating pattern emerges for multiples of $11$:
$10$ is $1$ less than $11$
$100$ is $1$ more than $9\times 11$
$1000$ is $1$ less than $91\times 11$
$10000$ is $1$ more than $909\times 11$
$100000$ is $1$ less than $9091\times 11$
$1000000$ is $1$ more than $90909\times 11$
and so on.

If we write $m11$' as shorthand for 'a multiple of $11$', we see that odd powers of $10$ are $m11-1$, and even powers of $10$ are $m11+1.$

For example, to find out if $54637$ divisible by $11,$ we can use that idea and work from the right:

$54637=7+3\times(m11-1)+6\times(m11+1)+4\times(m11-1)+5\times(m11+1)$,

which equals $m11+(7-3+6-4+5)$ or $m11+11$. Therefore $54637$ must be a multiple of $11$.

### Multiples of 7 and larger prime numbers

There isn't a quick test using the digits to see if a number is a multiple of $7,$ but there is an efficient method to work out if it is. Click to see it.

To see whether a number is divisible by $7$, you can remove multiples of $7$ and see what is left.

Example: is $26481$ a multiple of $7$?

$26481 = 21000 + 5481$, so $26481$ is a multiple of $7$ if $5481$ is.

$5600$ is a multiple of $7$, and $5600 = 5481 + 119$, so $26481$ is a multiple of $7$ if $119$ is.

$119 = 70 + 35 + 14$, so $26481$ must be a multiple of $7$.

This kind of reasoning works for any number - not just multiples of $7$.

T.R.Mukundan wrote to tell us about another test for divisibility by $7$ he has thought of. See the notes for details.

### Divisibility tests using remainder arithmetic

Thinking about remainders, it's possible to devise a divisibility test for any number. Click to read more.

A test for divisibility by any number can be devised using remainder arithmetic.
For example, we can devise a test for divisibility by $7$ as follows:

The remainder when $10$ is divided by $7$ is $3$, so the remainder when $100$ ($=10\times 10$) is divided by $7$ is $3\times 3=9$ (which is $7+2$, so the actual remainder is $2$).

If we write $m7$' as shorthand for 'a multiple of $7$', we can see why this works:
$10 = m7 + 3$ so $10^2 = (m7+3)^2= (m7)^2 + (6\times m7) + 3^2 = m7 + 9$.

Using our shorthand: $10=m7+3$ so $100=m7+9=m7+2$.

Hence $1000 = m7 + 2\times 3 = m7 + 6$, or $m7 - 1$.

[Check:
$10 = m7 + 3$
so $10^2 = m7 + 2$
and $10^3 = (m7 + 3)(m7 + 2) = m7 + 6$]
and $10^4 = m7 - 1\times 3 = m7 - 3$, or $m7 + 4$, and so on.]

Example:
To show that $18956$ is divisible by $7$, work from right to left:

$18956 = m7+[6+(5\times 3)+(9\times 2)-(8\times 1)-(1\times 3)]=$
$= m7+28 = m7+4\times 7$

The number $a b c d e$' is divisible by $7$ if $e+3d+2c-b-3a$ is divisible by $7$.
Not very easy to remember!

This method, using 'remainder arithmetic', can be adapted to any divisor.
For example, a test for $13$ would use the fact that $10 = m13 - 3$, and associate a power of $-3$ with each digit:
$10 = m13 - 3$
so $10^2 = m13 + 9$
and $10^3 = m13 - 27 = m13 - 1$
and $10^4 = m13 + 3$, and so on.

The number $a b c d e$' is divisible by $13$ if $e-3d+9c-b+3a$ is divisible by $13$.

Example:
To show that $46384$ is divisible by $13$, work from right to left:

$46384 = m13+[4-(8\times 3)+(3\times 9)-(6\times 1)+(4\times 3)]=$
$= m13+13$

### Remainder arithmetic for checking calculations

Thinking about remainders, it's possible to check the answers to calculations involving multiplication. Click to read more.

What is the final digit of $34\times 57?$

Without doing the full multiplication, we know it must be $8$, because $8$ is the final digit of $4\times 7$.

But how do we know?

Because $34\times 57 = (30\times 57)+(4\times 57) = m10+(4\times 50)+(4\times 7) = m10+m10+8 = m10+8$.

In this example 'final digit' means 'remainder when divided by $10$'. To find the remainder in the product (of $34$ and $57$), we need only find the product of the remainders ($4$ and $7$). This rule works, for essentially the same reason, for remainders when we divide by numbers other than $10$.

Using this rule, there is a method called 'casting out nines' to check calculations using remainders when dividing by $9$. For example, suppose I work out $256\times 77$ and I get the answer $19612$. The remainder when I divide ($256\times77$) by $9$ should be the product of the remainders when I divide $256$ and $77$ by $9.$

Recall from the divisibility by $9$ test that $10,100,1000,...$ are all $m9+1,$ so $256$ is $m9+2+5+6 = m9 + 13.$ $13 = m9 +1+3=m9+4.$ Therefore the remainder when $256$ is divided by $9$ is $4$, and $4$ is called the digital root of $256.$

The remainder when $77$ is divided by $9$ is the digital root of $77$. $7+7=14$ and $1+4=5$ so the remainder when $77$ is divided by $9$ is $5$.

Therefore the remainder when $256\times77$ is divided by $9$ should equal the remainder when $4\times5$ is divided by $9$ (which is $2$). However, my answer of $19612$ has digital root of $1$ ($1+9+6+1+2=19, 1+9=10, 1+0=1$), so the remainder when $19612$ is divided by $9$ is $1.$ So I must have made a mistake in my calculation.

Beware: casting out nines may detect a wrong answer (like that above) but it cannot guarantee a correct one. For example, $19721$ has digital root $2$, but the 'final digit test' (which could be called 'casting out tens') shows that it cannot be the answer to $256\times 77$.

[Attending to remainders is the essence of 'modular arithmetic'. The genius C F Gauss gave the first formal account of this in his 1801 book Disquitiones Arithmeticae, which he published at the age of 24]. You can read more about modular arithmetic in the article Modular Arithmetic.

### Divisibility tests using modular arithmetic

An alternative way to think about using remainders is to use modular arithmetic (see the article Modular Arithmetic).  For example, since $30 = 4 \times 7 + 2$ we have $30 \equiv 2 \text{ mod }7$, i.e. $30 \text{ mod }7$ is equal to the remainder when $30$ is divided by $7$. Click to read more.

Divisibility by 3

A number $n$ is divisible by $3$ if (and only if) $n \equiv 0 \text{ mod }3$.
Let $n$ be a four digit number with the digits $a\,b\,c\,d$, so we have $n=1000a+100b+10c+d=10^3a + 10^2b+10c+d$.
Working in modulo $3$ we have $10 \equiv 1 \text{ mod }3$, and so $10^2 \equiv 1^2 = 1 \text{ mod }3$, etc.
This means we have:
\begin{align}
n &= 10^3 a + 10^2 b + 10 c + d\\
&=[1a + 1b + 1 c + d] \text{ mod }3\\
&=[a+b+c+d] \text{ mod }3
\end{align}
And so $n$ is divisible by $3$ if, and only if, $a+b+c+d \equiv 0 \text{ mod 3}$, i.e. $a+b+c+d$ is a multiple of 3.

This argument can be generalised to any number of digits.

Divisibility by 9

We have $10 \equiv 1 \text{ mod }9$, and so $10^2 \equiv 1 \text{ mod }9$, etc.  Following the same arguments as for modulo $3$, we can see that a number $n$ is a multiple of 9 if, and only if, the sum of the digits is a multiple of $9$.

Divisibility by 11

Working modulo $11$ we have $10 \equiv -1 \text{ mod } 11$ (as $10$ is one less than a multiple of $11$).
This means that $10^2 \equiv (-1)^2 = 1 \text{ mod } 11$, etc.
If $n=10^3a+10^2b+10c+d$, as before, we have:
\begin{align}
n &= 10^3 a + 10^2 b + 10 c + d\\
&=\big[ (-1)^3a + (-1)^2b + (-1) c + d \big] \text{ mod }11\\
&=[-a+b-c+d] \text{ mod }11
\end{align}
And so $n$ is divisible by 11 if, and only if, $-a+b-c+d$ is divisible by 11.

### Special Tests

With some ingenuity, particular tests can be contrived for some integers. Click to see some examples and challenges.

• 7: "Double the units and subtract from the tens", e.g. $1365\rightarrow 136-(2\times 5)=126\rightarrow 12-(2\times 6)=0$. If the chain ends in $0$ or a multiple of $7$, then the original number is divisible by $7$.
• 11: "Subtract the units from the tens", e.g. $1364\rightarrow 136-4$ etc.
If the chain ends in $0$, then the original number is divisible by $11$.
• 13: "Add the tens to $4$ times the units", e.g. $1365\rightarrow 136+20$ etc.
If the chain ends in a multiple of $13$, then the original number is divisible by $13$.
• 19: "Add the hundreds to $4$ times the rest", e.g. $1311\rightarrow 13+44$ etc.
If the chain ends in a multiple of $19$, then the original number is divisible by $19$.
Challenge: Can you explain why each of these four tests works?

By a happy 'coincidence', $1001$ is the product of $7$, $11$ and $13$. This fact underlies another test for divisibility by these three prime numbers: see the entry for '1001' in David Wells' fascinating book 'The Penguin Dictionary of Curious and Interesting Numbers'.

### Final Problem:

If the digits $5$, $6$, $7$ and $8$ are inserted at random in $3$_$1$_$4$_$0$_$92$ (one in each space), what is the probability that the number created will be a multiple of $396$?

100%

The ten digit number will be a multiple of $4$, $9$ and $11$ ($2^2\times 3^2\times 11 = 396$) irrespective of where the digits $5$, $6$, $7$ and $8$ are placed.