# Divisibility Rules

Finding remainders is one of important concept in arithmetic.  For example, in finding units digit of an expression, H.C.F etc finding remainder is very important.
When 100 is divided by 8, we get 4 as remainder.  This can be represented as 100 = 8×k + 4.  Here k = 12 and remainder is 4.
In competitive exams, the problems are not straight forward.  So learn the following rules and techniques carefully.
The following rules are very important:

Rule 1: If $N = A \times B \times C....$ then the remainder when N is divided by D is equal to the product of the remainders when A, B, C ... are divided by D.
$\Rightarrow {\displaystyle\left( {\frac{N}{D}} \right)_R}$ = ${\left( {\displaystyle\frac{A}{D}} \right)_R}$ × ${\left( {\displaystyle\frac{B}{D}} \right)_R}$ × ${\left( {\displaystyle\frac{C}{D}} \right)_R}...$
Here ${\displaystyle\left( {\frac{N}{D}} \right)_R}$ means the remainder when N is divided by D

Solved Example 1:
Find the remainder when 1201 × 1203 ×1205 × 1207 is divided by 6.
Explanation:
If you don't know the above rule, this problem is really calculation intensive.
But by applying the above rule, when 1201, 1201, 1203, 1204 divided by 6, leaves remainders 1, 3, 5, 1. The product of these remainders = 15.
When 15 is divided by 6, Remainder is 3.

Rule 2: If $N = A + B + C....$ then the remainder when N is divided by D is equal to the sum of the remainders when A, B, C ... are divided by D.
$\Rightarrow {\displaystyle\left( {\frac{N}{D}} \right)_R}$ = ${\left( {\displaystyle\frac{A}{D}} \right)_R}$ + ${\left( {\displaystyle\frac{B}{D}} \right)_R}$ + ${\left( {\displaystyle\frac{C}{D}} \right)_R}...$

Solved Example 2:
Find the remainder when 1! + 2! + 3! + 4! + 5! + .......100! is divided by 24.
Explanation:
By applying rule 2, we divide the terms of the above expression individually, and add them to get the final remainder.  But from 4! onwards all the terms leave a remainder 0 when divided by 24.
So the remainder = 1 + 2 + 6 + 0 + 0....... = 9

## General Divisibility rules:

Let us a take a number ABCDEF.  In decimal system this number can be written as
100,000A + 10,000B + 1000C + 100D + 10E + F

### Divisibility Rule for 2:

We can easily observe that from rule 2, if ABCDEF has to be divisible by 2, 2 must divide all the six terms above.  It is evident that except F remaining numbers are divisible by 2.  So if F is divisible by 2 then the number ABCDEF is divisible by 2.

### Divisibility Rule for 5:

Since all the terms except F is divisible by 5, the number is divisible when F is divisible by 5, or F must be 0 or 5.

### Divisibility Rule for 4:

We can see that Except last two terms 10E and F, the remaining terms are divisible by 4. so If the last two digits are divisible by 4, the entire number is divisble by 4.

### Divisibility Rule for 8:

Except last three terms the remaining terms are divisible by 8. So if the last three digits are divisible by 8 then the number is divisible by 8.
Thumb Rule: for 2, 4, 8, 16... we need to check the last 1, 2, 3, 4 ... digits. Observer there 1, 2, 3, 4 are the powers of the divisor with base 2.

### Divisibility Rule for 3, 9:

100,000A + 10,000B + 1000C + 100D + 10E + F = 99999A + 9999B + 999C + 99D + 9E + (A + B + C + D + E + F)
We can see that Except (A + B + C + D + E + F) remaining terms are divisible by 3, 9.  If the digit sum is divisible by 3, 9 then the number ABCDEF is divisible by 3, 9. (A + B + C + D + E + F) is called digit sum of a number.

### Divisibility Rule for 11:

100,000A + 10,000B + 1000C + 100D + 10E + F = 100,001A + 9,999B + 1,001C + 99D + 11E + (-A + B - C + D - E + F)
From above we know that except (-A + B - C + D - E + F) the remaining digits are divisible by 11. So if the difference between the sum of the digists in the even places and odd places is 0 or multiple of 11 then the number is divisible by 11.

### Divisibility Rule for 6, 12 or any composite number:

If a composite divisor can be written as a product of co-primes and each of these co-primes divide the given number exactly, then that number is divisible by the divisor.  So if 2, 3 divide the given number exactly then 6 divides that number exactly.  Similarly, divisibility for 12 is to check divisibility for 3, 4.

### Divisibility for 7, 13, 17...:

The existing seed method rule is not good enough to solve problems given in examination.  So we learn some important formulas to solve questions easily.

## Fermat's little theorem:

A number $a^{p-1}$ is divided by p, then remainder is 1. Here P is prime.
Simbolically, ${\left( {\displaystyle\frac{{{a^{p - 1}}}}{p}} \right)_R} = 1$
or ${a^{p - 1}} \equiv 1({\text{mod P}})$
The advantage of using above format is that we can add, subtract, multiply and raise to some power to the numbers on the both sides of equivalent sign.

Solved Example 3:
What is the remainder when ${8^{100}}$ is divisible by 17.
Explanation:
This is an extremely difficult problem to solve with out Fermat's little theorem.  By applying Fermat's little theorem , We know that ${{8^{16}}}$  when divided by 17, the remainder is 1.
So divide 100 by 16 and find the remainder.  Remainder = 4
Therefore, 100 = (16 × 6) + 4
Now this problem can be written as $\dfrac{{{8^{100}}}}{{17}}$ = $\dfrac{{{8^{16 \times 6 + 4}}}}{{17}}$ = $\dfrac{{{{\left( {{8^{16}}} \right)}^6} \times {8^4}}}{{17}}$
Now this problem simply boils down to $\dfrac{{{{\left( 1 \right)}^6} \times {8^4}}}{{17}}$ = $\dfrac{{{8^4}}}{{17}}$
${8^4}$ = ${8^2}\times {8^2}$, we need to find the remainder when 64 × 64 is divisible by 17. Or 13 × 13 = 169.  When 169 is divided by 17, remainder is 16.
Note:  When you divide 100 by 16, find only remainder because what ever be the quotient, one power anything will become 1.

## Wilson's theorem:

If P is a prime number then (P - 1)! + 1 is divided by P the remainder is 0. or ${\left( {\displaystyle\frac{{\left( {P - 1} \right)! + 1}}{P}} \right)_R} = 0$
or $(p - 1)! + 1 \equiv 0\left( \text{mod P} \right)$

### Simplifying using congruence mod m:

$a \equiv b\left( {\bmod m} \right)$ or ${\left( {\dfrac{a}{m}} \right)_{\mathop{\rm R}\nolimits} } = b$
The above expression can be read as, 'a' is congruent to b, mod m.
This means, when a is divided by 'm' the remainder is b.  (or) a, b gives same remainder when divided by m.
Now the following rules follows,
1. ${\left( {\dfrac{{a + k}}{m}} \right)_{\mathop{\rm R}\nolimits} } = b + k$
If you add a value k on both sides and continue your calculation
2. ${\left( {\dfrac{{a \times k}}{m}} \right)_{\mathop{\rm R}\nolimits} } = b \times k$
3. ${\left( {\dfrac{{{a^k}}}{m}} \right)_{\mathop{\rm R}\nolimits} } = {b^k}$
Important: Never divided a, b with a number k.

Solved Example 4:
Find the remainder when 39! is divided by 41.
Explanation:
Substituting p = 41 in the wilson's theorem, we get
$\dfrac{{40! + 1}}{{41}} = 0$
$\dfrac{{40 \times 39! + 1}}{{41}} = 0$
$\dfrac{{ - 1 \times 39!}}{{41}} = - 1$
Cancelling -1 on both sides,
$\dfrac{{39!}}{{41}} = 1$

Alternatively:
By using congruent method
$(41 - 1)! + 1 \equiv 0\left( \text{mod 41} \right)$
40! +1 = 0 (mod 41)
40 × 39! = -1 (mod 41)
- 1×39! = -1 (mod 41)
Now by dividing the left hand expression by 41,
0 -1×39! = -1 (mod 41)
Cancelling -1 on both sides,
39! = 1 (mod 41)
So the remainder when 39! is divided by 41 is 1.

## Euler's Totient theorem:

If the divisor is not a prime number we cannot apply fermat little theorem.  So we learn Euler Totient theorem.
The remainder when ${N^{\phi (N)}}$ is divided by N is 1.  Here $\phi (N) = N\left( {1 - \dfrac{1}{a}} \right)\left( {1 - \dfrac{1}{b}} \right)\left( {1 - \dfrac{1}{c}} \right)...$
a, b, c .. are prime factors of the number N when N is written in prime factorization format.  $N = {a^p}.{b^q}.{c^r}...$

Solved Example 6:
Find the remainder when ${5^{100}}$ when divided by 18.
Explanation:
Here N = $18 = 2 \times {3^2}$
$\phi (18) = 18\left( {1 - \dfrac{1}{2}} \right)\left( {1 - \dfrac{1}{3}} \right)$ = 6
So ${5^6}$ when divided by 18, remainder is 1.
So we can write the given expression ${5^{100}} = {\left( {{5^6}} \right)^{16}} \times {5^4}$ = ${\left( 1 \right)^{16}} \times {5^4}$ = ${5^2} \times {5^2} = 7 \times 7 = 49$
Now 49 when divided by 18, remainder is 13.

Solved Example 7:
Find the remainder when ${30^{{{32}^{34}}}}$ is divided by 11.
Explanation:
We know that as per fermat little theorem, ${30^{10}}$ when divided by 11 leaves remainder 1.
So We try to write the given expression in this format. i.e., ${32^{34}}$ = 10k + r where k is some quotient and r is remainder.
You can use Euler totient theorem to find the remainder. But the remainder when any number when divided by 10, is the units digit of that number.
${32^{34}}$ units digit is same as ${2^{34}}$
We know that cyclicity for 2 is 4. So ${2^{34}} = {\left( {{2^4}} \right)^8} \times {2^2}$ = ${\left( 6 \right)^8} \times 4 = 6 \times 4 = 4$
(Read this chapter for better understanding)
So ${30^{{{32}^{34}}}}$ = ${30^{(10k + 4)}} = {\left( {{{30}^{10}}} \right)^k} \times {30^4}$ = ${\left( 1 \right)^k} \times {30^4}$ = ${8^4} = {2^{12}} = {2^{10}} \times {2^2}$ = 4

Solved Example 8:
What is the remainder when 2222^5555 + 5555^2222 is divided by 7?
Explanation:
Let us take each part of the above expression and find the remainder.
$\dfrac{{{{2222}^{5555}}}}{7}$ = $\dfrac{{{3^{5555}}}}{7}$
Now we apply Fermat's little theorem. ${\left[ {\dfrac{{{a^{p - 1}}}}{p}} \right]_{{\mathop{\rm Re}\nolimits} m}} = 1$
5555 when divided by 6, remainder is 5
So 5555 = 6k + 5
$\dfrac{{{3^{5555}}}}{7}$ = $\dfrac{{{3^{6k + 5}}}}{7}$ = $\dfrac{{{3^{6k}} \times {3^5}}}{7}$ = $\dfrac{{{{\left( {{3^6}} \right)}^k} \times {3^5}}}{7}$ = $\dfrac{{{{\left( 1 \right)}^k} \times {3^5}}}{7}$ = $\dfrac{{{3^2} \times {3^2} \times 3}}{7}$ = $\dfrac{{2 \times 2 \times 3}}{7} = 5$
Now take the second part of the expression.
$\dfrac{{{{5555}^{2222}}}}{7}$ = $\dfrac{{{4^{2222}}}}{7}$
Again we apply Fermat's little theorem. Divide 2222 by 6 and find remainder.
2222 = 6k + 2
$\dfrac{{{4^{2222}}}}{7}$ = $\dfrac{{{{\left( {{4^6}} \right)}^k} \times {4^2}}}{7}$ = $\dfrac{{{{\left( 1 \right)}^k} \times {4^2}}}{7}$ = $\dfrac{{{4^2}}}{7}$ = 2
Finally, $\dfrac{{{{2222}^{5555}} + {{5555}^{2222}}}}{7}$ = $\dfrac{{5 + 2}}{7} = 0$

Solved Example 9:
If the first 99 natural numbers are written side by side to form a new number 123456..........9899, then find the remainder when this number is divided by 11.
Explanation:
Any number that is divided by 11 leaves remainder which is equal to the difference of sum of digits in odd places and Sum of the digits in even places
Sum of the digits at odd places:
123456789101112131415161718192021 ...........................96979899
= (1+3+5+7+9) + (1+2+3+4+.....9) × 9 = 430
(From 11 to 99, 1 to 9 occurs 9 times)
Sum of digits at even places:
123456789101112131415161718192021 ...........................96979899
= (2 + 4 + 6 + 8 ) + 1 × 10 + 2 × 10 ..........9 × 10 = 20 + 450 = 470
Difference = 470 - 430 = 40
So remainder = 40/11 = 7

Solved Example 10:
123456789101112.... . 434445 . Find the remainder when divided by 45?
Explanation:
Divisibility for 45 is, the given number should be divisible by 9 as well as with 5.
Let the given number is N.
N has unit digit 5 so it is divisible by 5.
Now the divisibility for 9 is sum of the digits of N should be divisible by 9.
Digit sum of N = (1 + 2 + 3 + ... + 9) + 1 × 10 + (1 + 2 + 3 + ... + 9) + 2 × 10 + (1 + 2 + 3 + ... + 9) + 3 × 10 + (1 + 2 + 3 + ... + 9) + 4 × 6 + (1 + 2 + 3 + 4 + 5)
= 45 + 10 + 45 + 20 + 45 + 30 + 45 + 24 + 15  = 279
279 when divided by 9, remainder 0. So N can be written as 9m
So, N = 5k = 9m
So the given N is both multiple of 5 and 9. So it is exactly divisible by 45. So remainder = 0