Monday, September 3, 2012

DIVISIBILITY OF A NUMBER BY 3,6 OR 9

In school at secondary level, we are used to follow a method to find whether a given number is divisible by 3,6, and 9.
  • Dividing by 3
    1. Add up all the digits in the number.
    2. Find out what the sum is. If the sum is divisible by 3, so is the number
    3. For example: 12123 (1+2+1+2+3=9) 9 is divisible by 3, therefore 12123 is too!
  • Dividing by 6
  1. Add up all the digits in the number.
  2. Find out what the sum is. If the sum is divisible by 3 and 2, the number is divisible by 6.
  3. For example: 12120 (1+2+1+2+0=6) 9 is divisible by 3, therefore 12123 is too!
  • Dividing by 9
  1. Almost the same rule and dividing by 3. Add up all the digits in the number.
  2. Find out what the sum is. If the sum is divisible by 9, so is the number.
  3. For example: 43785 (4+3+7+8+5=27) 27 is divisible by 9, therefore 43785 is too!
Now, knowing the method of finding the divisibility, let's try to prove how this work.

Take the Number that we consider as $P$ and it is represented in standard method as following,

$$ P=a_na_{n-1}a_{n-2}\dots a_{2}a_{1}$$

Where this can be represented accurately as following,

$$P=a_n\times 10^{n-1}+a_{n-1}\times 10^{n-2}+a_{n-2}\times 10^{n-3}+\dots +a_2\times 10^1+a_1\times 10^0$$
or
$$ P=\sum \limits_{r=1}^{n}a_r\times 10^{r-1} \qquad \qquad \dots \mathrm{(A)} $$

case 1: Divisibility of a number by 3

$$\begin{align}
\sum \limits_{r=1}^{n} a_r&=3N \qquad (N\in \mathbb{Z})\qquad \qquad \dots \mathrm{(i)}\\
\sum \limits_{r=2}^{n} a_r+a_1&=3N\qquad \qquad \qquad \dots \mathrm{(a)}\\
a_1&=3N-\sum \limits_{r=2}^{n}a_r\\
\end{align}$$

from (a) and (A)

$$\begin{align}
P&=\sum \limits_{r=2}^{n}a_r \times 10^{r-1} +a_1\\
&=\sum \limits_{r=2}^{n}a_r\times 10^{r-1}+3N -\sum \limits_{r=2}^{n} a_r\\
&=\sum \limits_{r=2}^{n}(a_r\times 10^{r-1}-a_r)+3N\\
&=3N+\sum \limits_{r=2}^{n} a_r(10^{r-1}-1)\\
&=3N+\sum \limits_{r=2}^{n}a_r(9\times \underbrace{111\dots 111}_{(r-1)\,ones})\\
&=3N+9\sum \limits_{r=2}^{n}a_r\left[ \sum \limits_{i=2}^{r}10^{r-i}\right]\\
P&=3\left[ N+3\sum \limits_{r=2}^{n} a_r\left( \sum \limits_{i=2}^{r} 10^{r-i} \right) \right] \\
\end{align}$$

So when the requirement stated in the equation (i) is fulfilled the number - P is devisible by 3.

ii.

$$\sum \limits_{r=1}^{n}a_r=3N$$ and if $$P=2N'\qquad (N,N' \in \mathbb{Z})$$

According to i., P is divisible by 3, but P is also divisible by 2.

From this we can deduct, when above requirements are fulfilled, P is divisible by 6.

iii.

$$\begin{align}
\sum \limits_{r=1}^{n}a_r&=9N \qquad \qquad (N\in \mathbb{Z})\qquad \dots \mathrm{(ii)} \\
\sum \limits_{r=2}^{n}a_r+a_1&=9N \\
a_1&=9N-\sum \limits_{r=2}^{n}a_r\qquad \qquad \dots \mathrm{(b)}\\
\end{align}$$

From (b) and (A),

$$\begin{align}
P&=\sum \limits_{r=2}^{n}a_r\times 10^{r-1}+a_1\\
&=\sum \limits_{r=2}^{n}a_r\times 10^{r-1}+9N-\sum \limits_{r=2}^{n}a_r\\
&=\sum \limits_{r=2}^{n}(a_r\times 10^{r-1}-a_r)+9N\\
&=9N+\sum \limits_{r=2}^{n}a_r(10^{r-1}-1)\\
&=9N+\sum \limits_{r=2}^{n}a_r(9\times \underbrace{111\dots 111}_{(r-1)\,ones})\\
&=9N+9\sum \limits_{r=2}^{n}a_r\left[ \sum \limits_{i=2}^{r}10^{r-i} \right] \\
P&=9\left[ N+\sum \limits_{r=2}^{n}a_r\left( \sum \limits_{i=2}^{r}10^{r-i}\right) \right]\\
\end{align}$$

So when the requirement stated in the equation (ii) is fulfilled the number - P is divisible by 9.

Now, from the above i,ii and iii proofs we can say that when the sum of the digits of a number is equal to 3,9 or even, we can divide it by 3,6 and 9 appropriately. But there can be a situation where the sum of the digits of a large number is also another large number where we cannot directly say that it is divisible by 3 or 9. For example take the number - 11938197159817956982923. The sum of the digits of this number is equal to 123. The sum of the number is also a considerably larger number. In this situation what we do is take the second number and again take the sum of the digits of the number. So, if the sum of the digits of that number is divisible by 3,9 or divisible by 3 and even (in this case we get directly either 3,6 or 9), according to the above proof we can say that the second number is divisible by 3,9 or divisible by 6. If so, according to the above proof we can say that the first number that is given to us in the first place, is also divisible by 3,9 or 6 accordingly.








References