﻿ A Grand Theorem on Weighted Digit Sums for Digital Representations of Numbers
San José State University

applet-magic.com
Thayer Watkins
Silicon Valley,
& the Gateway
to the Rockies
USA

A Grand Theorem on
Weighted Digit Sums for
Digital Representations of Numbers

One of the first bits of interesting mathematics a child learns is that the sum of the digits of all multiples of nine from 9 to 90 is 9. For 99 the sum of the digits is 18 but the sum of the digits of 18 is 9. The digit sum of 99 is 9. This does not occur for the multiples of the other digits, but something more sophisticated does occur.

## Special CaseTwo Digit Numbers to Base 10

Let n be a two digit number to the base 10; i.e.,

#### n = 10a + b

where a and b are digits. Let m be a digit greater than 1. Its weight hm is equal to (10−m). The weighted sum of the digits of n for m is hma+b. This will be denoted as Sm(n). If that sum is a two digit number the process is repeated until the result is a single digit. That digit is the weighted digit sum of n with respect to m. It is denoted as Dm(n).

Thus

#### Dm(n) = Sm(Sm(…Sm(n))...)

Let Lm be the largest multiple of m that is less than 10.

Theorem 1: If n is a multiple of m greater than 10 then

#### Dm(n) = Lm.

Illustrations:
Let m=8. Then hm=2 and Lm=8.

Consider the two digit multiples of 8; 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, and 96. Here are their weighted digit sums D8

#### D8(16) = 2*1 + 6 = 8 D8(24) = 2*2 + 4 = 8 D8(32) = 2*3 + 2 = 8 D8(40) = 2*4 + 0 = 8 D8(48) = 2*4 + 8 = D8(16) = 8 D8(56) = 2*5 + 6 = D8(16) = 8 D8(64) = 2*6 + 4 = D8(16) = 8 D8(72) = 2*7 + 2 = D8(16) = 8 D8(80) = 2*8 + 0 = D8(16) = 8 D8(88) = 2*8 + 8 = D8(24) = 8 D8(96) = 2*9 + 6 = D8(24) = 8

Now let m=7. Then hm=3 and L7=7.

Consider the first few two digit multiples of 7

The weight for 7 is h=3. For the first few multiples of 7.

#### D7(14) = 3*1 + 4 = 7 D7( 21) = 3*2 + 1 = 7 D7( 28) = 3*2 + 8 = D7(14) = 7 D7( 35) = 3*3 + 5 = D7(14) = 7 D7( 42) = 3*4 + 2 = D7(14) = 7 D7( 49) = 3*4 + 9 = D7(21) = 7

The same thing prevails down through m=5. But for m=4, m=3 and m=2 the situation is different. For m=4 the weight is 6.

#### D4(12) = 6*1 + 2 = 8 D4( 16) = 6*1 + 6 = D4( 12) = 8 D4( 20) = 6*2 + 9 = D4(12) = 8 D4( 24) = 6*2 + 4 = D4(16) = 8 D4( 28) = 6*2 + 8 = D4(20) = 8 D4( 32) = 6*3 + 2 = D4(20) = 8

But 8=L4 so these are conistent with the theorem.

For m=3 the weight is 7. Note that D3(12) = 7*1 + 2 = 9 and that L3=9.

For m=2 the weight is 8. Note that D2(12) = 8*1 + 2 = D2(10) = 8*1 + 0 = 8 and that L2=8.

## Proof

Let n=km+r. Then

#### Sm(n) = (10−m)a + b = 10a + b −ma = km +r −ma = (k−a)m + r

So Sm(n) is less than n and has the same remainder as n upon division by m. If n is a multiple of m the first single digit value that is encountered in the successive weighted sums is the largest multiple of m less thsn 10.

If n is not a multiple of m the first single digit value that is encountered in the successive weighted sums is the remainder r upon division of n by m.

## Numbers with Three or More Digits

Consider n=125 and m=8. The weight for 8 is 10−8=2. Weighted summation is applied to the first two digits of 125. That results in 4. The third digit of 125 is appended to the 4 to give 45. The weighted sum of 45 is 2*4+5=13 and the weighted sum 13 is 2*1+3=5. The remainder after division of 125 by 8 is indeed 5.

Now consider n=128, a multiple of 8. As in the above the weighted summation of the first two digits is 4. The third digit appended to 4 gives 48. The weighted summation of 48 is 16 and the weighted summation of 16 is 8. Thus the weighted digit sum of 128 with respect to 8 is 8, as the theorem says.

Consider again 128 but with m=4 and a weight of 6. the weighted summation of the first two digits is 8. This with the third digit appended is 88. The weighted summation of 88 with respect to 4 is 48+8=56. The weighted summation of 56 is 36 and the weighted summation of that is 24. The next successive weighted sums are 16, 12 and finally 8. Thus the weighted digit sum of 128 with respect to 4 is 8, as the theorem says.

For numbers with more than three digits the process is the same. The weighted digit sum is obtained for the first two digits on the left. The next digit is appended to that result and the weighted digit sum is obtained for that number. The process is continued until all of the digits have been appended to the preceding result and the weighted digit sum obtained.

## Theorem 2

It is clear from the preceding material that the mathematically interesting quantity is the remainder after the division of one number by another number. Let the remainder after the division of n by m be denoted as Rem(n, m).

It could be that the weighted sum with respect to 8 is the digit 9. But 9 is equivalent to 1 with respect to 8 since they have the same remainder upon division by 8. Thus what holds true concerns remainders. Then

#### Theorem 2: Rem(n, m) = Rem(Dm(n), m)

As noted above each summation of digits Sm preserves the remainder so it is preserved in the limit as Dm.

It is also notable concerning remainders that that for two numbers n1 and n2

#### Rem(n1+n2, m) = Rem( Rem(n1, m) + Rem(n2, m), m) Rem(n1*n2, m) = Rem( Rem(n1, m)*Rem(n2, m), m)

The common but awkward representation of the remainder function is in terms of the term, modulo. If n=km+r then

#### n modulo m = r or more commonly n mod m = r or less commonly n%m = r

The previous relations are the basis for modular arithematic.

## The Grand Theorem:

Let B be the base of the digital representation of numbers and nB denote the digital representation of the number n in the base B. Let m be a digit less than B. The weighted summation of a two digit number ab is ha+b with the weight h for weighted summation being (B−m).

• If n is a number which is not an exact multiple of m then the weighted digit sum of nB is the remainder after the division of n by m. If n is an exact multiple of m then the weighted digit sum of nB is the largest multiple\of m that is less than B.

#### Grand Theorem: Rem(n, m) = Rem(Dm(nB))

Note that Rem(Dm(nB)) is the same for all B.

Proof:

Let n=km+r. For a two digit number to base B equal to Ba+b the weighted digit sum Sm is ha+b. Since h=B−m this is equivalent to

#### Sm = (B−m)a + b = Ba + b −ma but (Ba+b)=(km+r) so Sm = km+r − ma = (k−a)m + r

Therefore Sm is a lesser multiple of m than n is and has the same remainder r with respect to division by m. Thus successive applications of weighted digit summation will ultimately end in the value of r if r>0 and the largest multiple of m if r=0. The weighted digit sum of any multiple of m has to be a multiple of m less than the base B. Therefore if the only multiple of m less than the base B is m itself then the the weighhted digit sum of a multiple of m is m.

Illustrations:

Consider the octal number 778. It is equal to

#### 778 = 7*8 + 7 = 6310.

The weight for 7 for octal numbers is 8−7=1. Therefore the digit sum of 778 is 168 whose digit sum is 7. . The division of 63 by 7 is 0. The remainder for the divsion of the digit sum of 7 by 7 is 0.

Now consider the octal number 1238. It is equal to

#### 1238 = 1*8² + 2*8 + 3 = 83.

Therefore the digit sum of 1238 is 6. The remainder for the division of 83 by 7 is 6, as the theorem says.

Now consider 1445 which is 1*5² + 4*5 + 4=4910.

Let m=4 so the weight is 1. The weighted digit sum of 14 is 5 but 510=105 and the digit sum of 105 is 1. The next digit of 4 appended to the 1 gives 14 whose digit sum is 105 and the digit sum of that is 1 so the digit sum of 1445 is 1. The remainder of 49 divided by 4 is 1.

## The case of the divisor m being greater than the number base B

If m>B the weight h is a negative number. Consider m=11 for B=10 and thus h=−1. For all of the two digit multiples of 11 D11(k*11=kk)=0.

For n=87 S11=(−1)8+7=−1. This result is in the nature of a remainder since 87=88-1. The ordinary remainder is obtained by adding the result to 11; i.e. 10.

For n=140 S11(14)=(−1)1+4=3, S11(30)=(−1)3 + 0 = −3. This plus 11 equals 8. Rem(140, 11) = 8.

Now consider m=12 for B=10 and thus h=−2. For n=144 D12(14)=2. Then D12(24)=0. For n=45 D12(45)=−3. Remainder=12−3=9.

Clearly something analogous to the above theorem is involved but to express it properly requires some new terminology or perhaps a redefinition of the remainder function. The remainder function was defined only for positive arguments. For n=km+r the remainder is given by

#### r = n − km

where k is chosen as its maximum value such that r is nonnegative. When n is negative k is a negative value that produces the smallest nonnegative value of r. Let the value of r be denoted as Mod(n, m). Then the relation is

#### Mod(n, m) = Mod(Dm(nB), m)

Illustration:

Consider n=523 with m=11 and thus h=−1 . Thus S11(52)=−3. Then S11((S11(−3))=−(−3)+3=6. The remainder for the division of 523 by 11 is 6.

Under the same conditions consider n=491. Then S11(49) = −4 + 9 = 5 and S11(51) = −5 + 1 = −4. And mod(−4 , 11) = −4 + 11 = 7. Rem(491, 11) = 7.

(To be continued.) ,

## Conclusions

The well known fact that the digit sums of the multiples of 9 are all equal to 9 can be marvelously generalized. The less well known fact that the digit sum of any number that is not a multiple of 9 is equal to its positive remainder upon division by 9 also can be generalized.

If Rem(n, m) is the remainder function for the division of n by m the general relationship is

#### Rem(n, m) = Rem(Dm(nB)

where nB is the digital representation of the number in the base B.