appletmagic.com Thayer Watkins Silicon Valley, Tornado Alley & BB Island USA 

with Modular 9 Arithmetic 
Modular 9 arithmetic is the arithmetic of the remainders after division by 9. For example, the remainder for 12 after division by 9 is 3. This is expressed as
Likewise 25=7 (mod 9) and 9=0 (mod 9). Note that 12+25=37 and that 37=1 (mod 9). But 3+7=10=1 (mod 9) so the equivalent of the sum of two numbers modulo 9 is equal to the modulo 9 equivalent of the sum of their modulo 9 equivalents.
The modulo 9 equivalent of 12 is 3 which is also the digit sum of 12. This is no coincidence. There is a very close relationship between the modulo 9 equivalents of numbers and their digit sums.
Integer  Digit Sum  Remainder
Function Mod 9 

1  1  1  
2  2  2  
3  3  3  
4  4  4  
5  5  5  
6  6  6  
7  7  7  
8  8  8  
9  9  0  
10  1  1  
11  2  2  
12  3  3  
13  4  4  
14  5  5  
15  6  6  
16  7  7  
17  8  8  
18  9  0 
The only difference between the values in the second and third columns is that for a multiple of 9 the remainder function is zero but in the second column the value is 9. This is reasonable in that 9=0 (mod 9). Let the remainder function for integer k be expressed as k%9 and the second column function as k#9. Rather than make a special case for the multiples of 9 it is more elegant to express the correspondence between the two functions as
The # function can be generalized to
The digit sum function is the special case of the k#n function when n=9.
The multiplication table for modulo 9 arithmetic is:
Multiplication Table for Modulo 9 Arithmetic  

0  0  0  0  0  0  0  0  0 
0  1  2  3  4  5  6  7  8 
0  2  4  6  8  1  3  5  7 
0  3  6  0  3  6  0  3  6 
0  4  8  3  7  2  6  1  5 
0  5  1  6  2  7  3  8  4 
0  6  3  0  6  3  0  6  3 
0  7  5  3  1  2  6  4  2 
0  8  7  6  5  4  3  2  1 
If the 0's were replaced by 9's and the table rearranged so the first column becomes the last column and the first row becomes the last row the result would be identical to the table for the sequences of digit sums.
The Rearrangement of the Multiplication Table for Modulo 9 Arithmetic With 9 Substituted for 0 


1  2  3  4  5  6  7  8  9 
2  4  6  8  1  3  5  7  9 
3  6  9  3  6  9  3  6  9 
4  8  3  7  2  6  1  5  9 
5  1  6  2  7  3  8  4  9 
6  3  9  6  3  9  6  3  9 
7  5  3  1  2  6  4  2  9 
8  7  6  5  4  3  2  1  9 
9  9  9  9  9  9  9  9  9 
This table is identical with the table of digit sums for multiples of numbers. The conclusion is that digit sum arithmetic is the virtually the same as modular 9 arithmetic except there is a replacement of 0's with 9's. The equivalence of 9 and 0 takes care of a small problem. The digit sum of all multiples of 9 is 9 except for the case of 0 times 9 which has a digit sum of 0. So the digit sum of all multiples of 9 is equivalent to 9.
In mathematical terminology there is an isomorphism between digit sum arithmetic and modular 9 arithmetic. All of the properties of associativity, distributivity, communtivity, identities and additive inverses carry over from modular 9 arithmentic to digit sum arithmetic. Multiplicative inverses exist for some elements but not all so neither entity is a mathematical field. In the table below the cases of products that yield the multiplicative identity; i.e., 1; are shown in red.
Multiplication Table for Modulo 9 Arithmetic  

0  1  2  3  4  5  6  7  8  
0  0  0  0  0  0  0  0  0  0 
1  0  1  2  3  4  5  6  7  8 
2  0  2  4  6  8  1  3  5  7 
3  0  3  6  0  3  6  0  3  6 
4  0  4  8  3  7  2  6  1  5 
5  0  5  1  6  2  7  3  8  4 
6  0  6  3  0  6  3  0  6  3 
7  0  7  5  3  1  2  6  4  2 
8  0  8  7  6  5  4  3  2  1 
As can be seen from the above table inverses exist for 1, 2, 4, 5, 7 and 8 but not for 0, 3 and 6.
HOME PAGE OF Thayer Watkins 