applet-magic.com Thayer Watkins Silicon Valley, Tornado Alley & BB Island USA |
---|
of Terminating Decimal Numbers |
The integral powers of numbers are just special cases of products so
DigitSum(nm) = (DigitSum(n))m
But the computation of DigitSum(nm) can be further simplified through a simplification of the exponent.
The DigitSum(nm) follows cycles or some even simpler pattern; i.e.,
m | ||||||||||
n | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 2 | 1 | 2 | 4 | 8 | 7 | 5 | 1 | 2 | 4 | 8 |
3 | 1 | 3 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 |
4 | 1 | 4 | 7 | 1 | 4 | 7 | 1 | 4 | 7 | 1 |
5 | 1 | 5 | 7 | 8 | 4 | 2 | 1 | 5 | 7 | 8 |
6 | 1 | 6 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 |
7 | 1 | 7 | 4 | 1 | 7 | 4 | 1 | 7 | 4 | 1 |
8 | 1 | 8 | 1 | 8 | 1 | 8 | 1 | 8 | 1 | 8 |
9 | 1 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 | 9 |
The patterns in the above table could be represented as
but a better representation would be
where for example h2(m)= remainder after division of m by 6 = (m mod 6) = m%6 and
m | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
h2(h) | 1 | 2 | 4 | 8 | 7 | 5 | 1 |
For the digits with a cyclical pattern
h2(m) | m mod 6 |
h4(m) | m mod 3 |
h5(m) | m mod 6 |
h7(m) | m mod 3 |
h8(m) | m mod 2 |
For 3, 6 and 9 the functions are even simpler; i.e.,
The nature of hn(m) depends upon whether for a digit n there exists a nonzero solution to the equation nq=1 or if there instead exists a solution to nq=9. If there exists a solution to nq=1 then hn(m) = m mod q. If instead there exists a solution to nq=9 then hn(m) = {0,1,...,q,q,...}.
The relationships between the solutions to nq=1 for n={2,4,8} is very simple. If qn is the solution for n, then
Likewise q8 = q2/3 = 6/3 = 2.
Furthermore, since DigitSum(2*5)=1, DigitSum((2*5)q2=1 and hence 5q2=1 and therefore q5=q2=6. Likewise DigitSum(7*4)=1 so q7=q4=3.
The patterns found above for the powers of integers carries over to the negative powers to some extent. For example, 2−1=0.5 so the DigitSum(2−1)=5 and DigitSum(2−1)=DigitSum(0.25)=7, etc. However the DigitSum(3−1) is not defined.
A limited tabulation of the digit sums of the negative powers of digits is shown below:
m | ||||||
n | −6 | −5 | −4 | −3 | −2 | −1 |
2 | 1 | 2 | 4 | 8 | 7 | 5 |
4 | 1 | 4 | 7 | 1 | 4 | 7 |
5 | 1 | 5 | 7 | 8 | 4 | 2 |
8 | 1 | 8 | 1 | 8 | 1 | 8 |
Although the reciprocal of 7 is a nonterminating decimal a digit sum may be defined for it of 4. This is possible because 7 has multiplicative inverse of 4 modulo 9; i.e., 7*4=1 mod 9. See Digit sums for repeating decimals. With DigitSum(7−1)=4 the pattern for the negative powers of 7 is the same pattern as the positive powers of 4; i.e., {1,4,7,1,4,7,....}.
If a is a terminating decimal then DigitSum(am) follows the same pattern as for DigitSum(nm). The decimal point is shifted but that does not affect the digit sum. For example, if a=0.4 then am=4m/10m and hence DigitSum(0.4m)=DigitSum(4m).
(To be continued.)
HOME PAGE OF Thayer Watkins |