applet-magic.com
Thayer Watkins
Silicon Valley,
Tornado Alley
& BB Island
USA

Main page for digit sum arithmetic


The Equivalence of Digit Sum Arithmetic
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


12 = 3 (mod 9)
 

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


k#9 = (k-1)%9 + 1
and
k%9 = (k+1)#9 - 1.
 

The # function can be generalized to


k#n = (k-1)%n + 1
and hence
k%n = (k+1)#n - 1.
 

The digit sum function is the special case of the k#n function when n=9.


DigitSum(k) = (k-1)%9 +1
 

The multiplication table for modulo 9 arithmetic is:

<
Multiplication Table for Modulo 9 Arithmetic
000000000
012345678
024681357
036036036
048372615
051627384
063063063
075312642
08765432 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
123456 789
246813 579
369369 369
483726 159
516273 849
639639 639
753126 429
8765432 19
999999999

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
 012345678
0000000000
1012345678
2024681357
3036036036
4048372615
5051627384
6063063063
7075312642
808765432 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 applet-magic
HOME PAGE OF Thayer Watkins