# Number System: 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×B×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.
$⇒{\left(\frac{N}{D}\right)}_{R}$ = ${\left(\frac{A}{D}\right)}_{R}$ × ${\left(\frac{B}{D}\right)}_{R}$ × ${\left(\frac{C}{D}\right)}_{R}...$
Here ${\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.
$⇒{\left(\frac{N}{D}\right)}_{R}$ = ${\left(\frac{A}{D}\right)}_{R}$ + ${\left(\frac{B}{D}\right)}_{R}$ + ${\left(\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(\frac{{a}^{p-1}}{p}\right)}_{R}=1$
or ${a}^{p-1}\equiv 1\left(\text{mod P}\right)$
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 little theorem.  By applying Fermat little theorem , We know that ${8}^{16}$  when divided by 17, the remainder is 1.
Now this problem can be written as ${\left({8}^{16}\right)}^{6}×{8}^{4}$
Now this problem simply boils down to ${\left(1\right)}^{6}×{8}^{4}$ =  ${8}^{4}$ = ${8}^{2}×{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.

## Wilson's theorem:

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

### Simplifying using congruence mod m:

$a\equiv b\left(modm\right)$ or ${\left(\frac{a}{m}\right)}_{\mathrm{R}}=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(\frac{a+k}{m}\right)}_{\mathrm{R}}=b+k$
If you add a value k on both sides and continue your calculation
2. ${\left(\frac{a×k}{m}\right)}_{\mathrm{R}}=b×k$
3. ${\left(\frac{{a}^{k}}{m}\right)}_{\mathrm{R}}={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
$\frac{40!+1}{41}=0$
$\frac{40×39!+1}{41}=0$
$\frac{-1×39!}{41}=-1$
Cancelling -1 on both sides,
$\frac{39!}{41}=1$

Alternatively:
By using congruent method
$\left(41-1\right)!+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}^{\varphi \left(N\right)}$ is divided by N is 1.  Here $\varphi \left(N\right)=N\left(1-\frac{1}{a}\right)\left(1-\frac{1}{b}\right)\left(1-\frac{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×{3}^{2}$
$\varphi \left(18\right)=18\left(1-\frac{1}{2}\right)\left(1-\frac{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}×{5}^{4}$ = ${\left(1\right)}^{16}×{5}^{4}$ = ${5}^{2}×{5}^{2}=7×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 ${32}^{2}$ = 4.  (Read this chapter for better understanding)
So ${30}^{{32}^{34}}$ = ${30}^{\left(10k+4\right)}={\left({30}^{10}\right)}^{k}×{30}^{4}$ = ${\left(1\right)}^{k}×{30}^{4}$ = ${8}^{4}={2}^{12}={2}^{10}×{2}^{2}$ = 4

Solved Example 8:
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 9:
ABCDEF is a six digit number divisible by 13.  Which of the following will necessarily be divisible by 13?
1.  5(A - D) + 2(B - E) - 2(C - F)
2.  4(A - D) + 5(B - E) - (C - F)
3.  4(A - D) + 2(B - E) - 5(C - F)
4.  4(A - D) + 3(B - E) - (C - F)
Explanation:
ABCDEF can be written as $A{.10}^{5}+B{.10}^{4}+C{.10}^{3}+D{.10}^{2}+E.10+F$
The remainders when 100000, 10000, 1000, 100, 10, 1 divided by 13 are 4, 3, 12, 9, 10, 1
So The remainder when any sixdigit number say ABCDEF is divided by 13 is given by 4A + 3B + 12C + 9D + 10E + F
$⇒$ 4A + 3B + 13C - C + 13D - 4D + 13E - 3E + F
$⇒$ (F-C) + 4(A-D)+3(B-E) + 13(C+D+E)
Since ABCDEF is divisible by 13, it follows that 4(A-D) + 3(B-E) - (C-F) is divisible by 13.  So correct option 4.
Alternate method:
130000 is a six digit number divisible by 13.
A - D = 1, B - E = 3, C - F = 0.
Only option 4 is satisfying.

Solved Example 10:
Some chocolates were distributed among all the students of first class and 11 chocolates were left.  Had the same number of chocolates been distributed among the students of second class, 5 chocolates would have been left.  If the number of students in the first class is 4 times of those in the second, find the total students in both the classes.
1. 10
2. 20
3. 30
4. Cannot be determined
Explanation:
Let the students in second class = k
$⇒$ students in the first class = 4k
If the number of chocolates is N, then
N = 4kp + 11- - - -  (1) or N = kq + 5 - - - - (2), where p and q are any integers.
(2) - (1) $⇒$ k(q - 4p) = 6
Hence, k is 6 or a factor of 6. i.e., 1, 2, 3, or 6
but K should not be 1, 2, 3 because when the number of chocolates divided among second class 5 chocolates are remaining.  So K should be greater than 5 i.e., 6
So total students in both the classes =k + 4k =  5k = 30
Alternate method:
Working with options
Option 1: when total students 5k = 10, then k = 2. Then remainder should not be 5. (when a number is divided by 2, remainders are 0, 1 only)
Option 2: 5k = 20 then k = 4. Remainder should not be 5
Option 3: 5k = 30, so students in the first class = 24, and second class = 6. Remainders are 11 and 5 possible.