Claim 1:
The divisibility rule for a number 'a' to be divided by 'n' is as follows. Express the number 'a' in base 'n+1'. Let 's' denote the sum of digits of 'a' expressed in base 'n+1'. Now n|a⟺n|s. More generally, a≡s(modn).
Example:
Before setting to prove this, we will see an example of this. Say we want to check if 13|611. Express 611 in base 14.
611=3×142+1×141+9×140=(319)14
where
(319)14 denotes that the decimal number
611 expressed in base
14. The sum of the digits
s=3+1+9=13. Clearly,
13|13. Hence,
13|611, which is indeed true since
611=13×47.
Proof:
The proof for this claim writes itself out. Let a=(amam−1…a0)n+1, where ai are the digits of 'a' in the base 'n+1'.
a=am×(n+1)m+am−1×(n+1)m−1+⋯+a0
Now, note that
n+1(n+1)kak×(n+1)k≡1(modn)≡1(modn)≡ak(modn)
aa=am×(n+1)m+am−1×(n+1)m−1+⋯+a0≡(am+am−1⋯+a0)(modn)≡s(modn)
Hence proved.
Claim 2:
The divisibility rule for a number 'a' to be divided by 'n' is as follows. Express the number 'a' in base 'n−1'. Let 's' denote the alternating sum of digits of 'a' expressed in base 'n−1' i.e. if a=(amam−1…a0)n−1, s=a0−a1+a2−⋯+(−1)m−1am−1+(−1)mam. Now n|a if and only n|s. More generally, a≡s(modn).
Example:
Before setting to prove this, we will see an example of this. Say we want to check if 13|611. Express 611 in base 12.
611=4×122+2×121+B×120=(42B)12
where
(42B)14 denotes that the decimal number
611 expressed in base
12,
A stands for the tenth digit and
B stands for the eleventh digit.
The alternating sum of the digits
s=B12−2+4=13. Clearly,
13|13. Hence,
13|611, which is indeed true since
611=13×47.
Proof:
The proof for this claim writes itself out just like the one above. Let a=(amam−1…a0)n+1, where ai are the digits of 'a' in the base 'n−1'.
a=am×(n−1)m+am−1×(n−1)m−1+⋯+a0
Now, note that
n−1(n−1)kak×(n−1)k≡(−1)(modn)≡(−1)k(modn)≡(−1)kak(modn)
aa=am×(n−1)m+am−1×(n−1)m−1+⋯+a0≡((−1)mam+(−1)m−1am−1⋯+a0)(modn)≡s(modn)
Hence proved.
Pros and Cons:
The one obvious advantage of the above divisibility rules is that it is a generalized divisibility rule that can be applied for any 'n'.
However, the major disadvantage in these divisibility rules is that if a number is given in decimal system we need to first express the number in a different base. Expressing it in base n−1 or n+1 may turn out to be more expensive. (We might as well try direct division by n instead of this procedure!).
However, if the number given is already expressed in base n+1 or n−1, then checking for divisibility becomes a trivial issue.