San José State University |
---|
applet-magic.com Thayer Watkins Silicon Valley, Tornado Alley & the Gateway to the Rockies USA |
---|
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.
Let n be a two digit number to the base 10; i.e.,
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
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
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
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.
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.
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.
Let n=km+r. Then
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.
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.
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
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
The common but awkward representation of the remainder function is in terms of the term, modulo. If n=km+r then
The previous relations are the basis for modular arithematic.
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).
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
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
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
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.
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
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
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.) ,
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
where nB is the digital representation of the number in the base B.
HOME PAGE OF Thayer Watkins |
This webpage dedicated to the memory of my daughter Storm. Many years ago she needed a project in mathematics for the wonderful grammar school (Black Pine Circle School in Berkeley) she attended. We talked about the marvelous fact that the digit sum of all multiples of nine is nine. She wanted to find something notable about the digit sums of the multiples of the other digits. She found cycles in the digit sums of the multiples of those other digits. But I had the feeling that there was much more mathematically to be found. That she did not live long enough to see the final result is one of the infinitude of my sorrows concerning the shortness of her life.