Testing for Divisibility by 9 and 11

We can easily test for divisibility by certain number e.g. 9 and 11.
To test for divisibility by 9 add up the digits. If the result is divisible by 9 then so is the number, and not otherwise. To test for divisibility by 11, alternatively add and subtract the digits. If the result is zero, the number is divisible by 11, and not otherwise.
More rigorously, let  
\[N=a_ma_{m-1}...a_1a_0=a_0+10a_1+...+10^{m-1}a_{m-1}+10^ma_m\]
.
Since  
\[10 \equiv 10^2 \equiv 10^3 \equiv ... \equiv 10^m \equiv 1 \; (mod \; 9)\]
,  
\[N = a_0+10a_1+...+10^{m-1}a_{m-1}+10^ma_m \equiv a_0+a_1+...+a_{m-1}+a_m \; (mod \; 9) \]
. If  
\[9 | N\]
  this congruence is equal to zero so  
\[9 | (a_0+a_1+...+a_{m-1}+a_m)\]
.
Since  
\[10 \equiv -1 \; (mod \; 11), \; 10^2=100 \equiv 1 \; (mod \; 11),..., 10^r \equiv (-1)^r \; (mod \; 11)\]

\[\begin{equation} \begin{aligned} N &= a_0+10a_1+...+10^{m-1}a_{m-1}+10^ma_m \\ & \equiv a_0-a_1+...+(-1)^{m-1}a_{m-1}+(-1)^ma_m \; (mod \; 11) \end{aligned} \end{equation}\]

If  
\[11 | N\]
  this congruence is equal to zero then  
\[11 | N\]
  this congruence is equal to zero so  
\[9 | N\]
.
Example:  
\[N=5647\]
.
\[5+6+4+7=22\]
  which is not divisible by 9, so 9 does not divide  
\[N\]
.
Example:  
\[N=7845\]
.
\[7845=5-4+8-7=2 \neq 0\]
  so 11 does not divide  
\[N\]
.

Add comment

Security code
Refresh