The DigitSum Function

Let n be a number and let Dec10(n) be the decimal depiction of n.Let DigitSum(z) be the ultimate amount of digits of a decimal depiction z; i.e., if thesum of digits of a decimal representation is greater than nine then the sum of that number\"sdigits is computed until a single digit is eventually obtained.This function, DigitSum( ), has several interesting properties; i.e.,DigitSum(x+y) = DigitSum(DigitSum(x) + DigitSum(y))DigitSum(x−y) = DigitSum(DigitSum(x) − DigitSum(y))DigitSum(x*y)=DigitSum(DigitSum(x)*y))DigitSum(x*y)=DigitSum(x*DigitSum(y))DigitSum(x*y)=DigitSum(DigitSum(x)*DigitSum(y))See number Sums for an evaluation and evidence of this propositions.The proposition that DigitSum(x*y)=DigitSum(DigitSum(x)*y)) creates that the sequences because that themultiples of 12 and also of 13 space the very same as the sequences for 3 (1+2) and also 4 (1+3), respectively.

You are watching: The sum of my digits is 12

Decimal representation of Numbers

In order for the following to make feeling one must stop reasoning of a number in state ofits decimal representation and think of a number in terms of an appropriate variety of tallymarks so three would it is in (|||) and also eleven (||||||||||||).Consider how one obtains the decimal depiction of a number. To get the critical digit onedivides the number by ten and also takes the remainder as the last digit. The last number is subtracted from the number and also the result divided by ten. Then the decimal representation ofthat quotient is sought. The process is repeated and also the next the last digit is obtained.An alternative characterization that the process of detect the decimal depiction of a number is that the k-th strength digit for a totality number n is:ck = (trunc)%10where trunc<> method the fractional component is thrown away and m%10 method the remainder afterdivision by 10. In regards to the terminology native the programming language Pascal theformula isck(n) = (n div 10k) mod 10The sum of the digits for a number n is thenSum = Σk ck(n),but this is not necessarily the digit amount for the number. The procedure has to it is in repeatediteratively top top the sum of the digits.

The Explanation of the trends of the Sequences

Consider 2 digits, a and b. If their sum is much less than ten thenDigitSum(a+b) = DigitSum(a)+DigitSum(b)and henceDigitSum(a+b) = DigitSum(DigitSum(a)+DigitSum(b)).But, if the sum of a and b is ten or much more then the decimal depiction of their amount is a one inthe ten\"s place and (a+b−10) in the unit\"s place. ThusDigitSum(a+b) = 1 + (a+b−10) = a+b−(10−1) = a+b−9For digits the DigitSum(a)=a and DigitSum(b)=b therefore DigitSum(DigitSum(a)+DigitSum(b)) = 1 + (a+b−10).Therefore for any kind of two digits a and bDigitSum(a+b) = DigitSum(DigitSum(a)+DigitSum(b)).This applies as well to the number in the k-th place. For this reason the general proposition forany two decimal depictions of numbers, x and yDigitSum(a+b) = DigitSum(DigitSum(a)+DigitSum(b)).For differences, if a and also b are digits and a>b thenDigitSum(a−b) = DigitSum(DigitSum(a)−DigitSum(b)).On the various other hand if aDigitSum(a−b) = DigitSum(DigitSum(a)−DigitSum(b)).Again this extends come the number in any type of place in a decimal depiction of a number.For any type of decimal number x and also y thenDigitSum(x±y) = DigitSum(DigitSum(x)±DigitSum(y)).Since multiplication is just repeated enhancement it likewise follows thatDigitSum(x*y) = DigitSum(DigitSum(x)*y)DigitSum(x*y) = DigitSum(x*DigitSum(y))and finallyDigitSum(x*y) = DigitSum(DigitSum(x)*DigitSum(y)).It to be previously noted that for any two number whose sum is better than ten,DigitSum(a+b) = 1 + (a+b−10) = a+b−(10−1) = a+b−9In basic then for any decimal depiction xDigitSum(x) = Sumofdigits(x) − m*9where m is such the DigitSum(x) is diminished to a single digit.Another way of express this is the the DigitSum for a number n is simply the remainder after department by 9; i.e., DigitSum(n)=(n%9). DigitSum arithmetic is simplyarithmetic modulo 9.For compare the multiplication table for modulo 9 arithmetic is:Multiplication Table because that Modulo 9 ArithmeticIf the 0\"s were replaced by 9\"s and the table rearranged so the first column i do not care the last column and the first rowbecomes the last heat the result would be similar to the table for the order of number sums.
000000000
The Rearrangement the the Multiplication Table because that Modulo 9 ArithmeticWith 9 Substituted for 0
123456789
246813579
369369369
483726159
516273849
639639639
753126429
876543219
999999999

Some Proofs

The evidence of the property that the DigitSum of any kind of multiple of nine is same to ripe starts through the noticeable propositionDigitSum(10*n) = DigitSum(n). Indigenous this it complies with from the proposition that DigitSum(x−y)=DigitSum(x)−DigitSum(y) thatDigitSum((10−1)*n) = 0 and also thusDigitSum(9*n) = 0but in modulo 9 arithmetic 0 is the exact same as 9, soDigitSum(9*n) = 9The means to know the sequence because that 8 is that as soon as 8 is included to any kind of digit except 0 or 1in any place the number is lessened by 2 and also one added to the digit of the following place. Thisresults in a network decrease in the sum of digits of one. Hence when 8 is added to 8 the digitbecomes 6, a reduction of 2, and also 1 is added to the next higher digit, a net decrease in thesum of the digits of 1. Thus added 8 come 8 results in a sum of number of 7. Including 8 to 7results in a sum of digits of 6, and also so on down to including 8 to 1 which provides 9. Even this fits right into the ascendancy in the sense that if 1 were alleviate by 1 the result would be 0 i m sorry is indistinguishable to 9 modulo 9. An in similar way adding 7 come a digit reduces the by 3 and also adds 1 come thedigit in the following place, a net reduction in the sum of number of 2. Therefore when 7 is included to 7the amount of digits is decreased to 5. As soon as 7 is added to 5 the sum of number is reduced to 3.When 7 is added to 3 the sum of digits is diminished to 1. If 7 is included to 1 the an outcome is 8,but that 8 might be consider as a palliation of 1 by 2 modulo 9. The addition of 7 to 8 resultsin a amount of digits of 6 and so on under to a sum of digits of 2. The addition of 7 to 2results in a amount of digits of 9, however that 9 deserve to be thought about 0 modulo 9 and thus it is a palliation of 2.

Generalization to other Number Bases

There is naught special about 9; it is just the number basic ten much less one. The digitsum sequences for multiples in thehexadecimal (base 16) number system is:
NumberRepeating Cycleof sum of Digitsof Multiples
22,4,6,8,a,c,e,1,3,5,7,9,b,d,f
33,6,9,c,f,3,6,9,c,f,3,6,9,c,f
44,8,c,1,5,9,d,2,6,a,e,3,7,b,f
55,a,f,5,a,f,5,a,f,5,a,f,5,a,f
66,c,3,9,f,6,c,3,9,f,6,c,3,9,f
77,e,6,d,5,c,4,b,3,a,2,9,1,8,f
88,1,9,2,a,3,b,4,c,5,d,6,e,7,f
99,3,c,6,f,9,3,c,6,f,9,3,c,6,f
aa,5,f,a,5,f,a,5,f,a,5,f,a,5,f
bb,7,3,e,a,6,2,d,9,5,1,c,8,4,f
cc,9,6,3,f,c,9,6,3,f,c,9,6,3,f
dd,b,9,7,5,3,1,e,c,a,8,6,4,2,f
ee,d,c,b,a,9,8,7,6,5,4,3,2,1,f
ff,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f
In general, for numbers of basic b the digit sums are tantamount to arithmetic modulo (b−1). The sequences i beg your pardon contain subsequences are the multiples of the components of (b−1)other 보다 unity.In the case of b=ten these components are 3 and 9. Therefore there room subsequences for 3,6,9.

See more: 2000 Honda Civic Maintenance Required Light On 2000 Civic, Maintenance Required Light

The lengths the the subsequences room (b−1) divided by the factors; i.e.,in the instance of b=ten 3 and 1. Because that b=sixteen the determinants are three, fiveand fifteen and also so subsequences take place for 3,6,9,c,f,5,a and the lengths of thesubsequences are 3, 5 and also 1.HOME web page OF applet-magicHOME page OF Thayer Watkins