§ 86. Divisibility Rules for 3 and 9
First, let us note that any number written using only the digit 9 is divisible by both 3 and 9; that is, 9, 99, 999, and so on. Indeed, 999 ÷ 3 = 333; 9999 ÷ 3 = 3333, and so forth.
999 ÷ 9 = 111; 9999 ÷ 9 = 1111, and so forth.
Having observed this, let us take any number, for example 2457, and decompose it into individual units of different orders (leaving the simple units undecomposed):
Let us decompose each thousand into 999 and 1, each hundred into 99 and 1, and each ten into 9 and 1. Then, instead of 2 thousands, we get 2 times 999 and 2 units; instead of 4 hundreds, we get 4 times 99 and 4 units; instead of 5 tens, we get 5 times 9 and 5 units. Consequently:
The addends 999, 99, and 9 are divisible by 3 and by 9; therefore, the divisibility of the given number by 3 or by 9 depends only on the sum 2 + 4 + 5 + 7; if this sum is divisible (or not divisible) by 3 or by 9, then the given number is also divisible (or not divisible) by these numbers. The sum 2 + 4 + 5 + 7 is the sum of the numbers expressed by the digits of the given number, written separately; for brevity, it is said to be the sum of the digits of the given number. Therefore: all and only those numbers are divisible by 3 whose sum of digits is divisible by 3; all and only those numbers are divisible by 9 whose sum of digits is divisible by 9.
In the number 2457, the sum of the digits is 18; 18 is divisible by 3 and by 9; hence, 2457 is also divisible by both 3 and 9. Indeed:
Since 9 is divisible by 3, any number divisible by 9 will also be divisible by 3. However, a number may be divisible by 3 and at the same time not divisible by 9. For instance, in the number 17331, the sum of the digits is 15; since 15 is divisible by 3 but not by 9, the number 17331 is divisible by 3 but not by 9.