## 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.
 0 0 0 0 0 0 0 0 0
The Rearrangement the the Multiplication Table because that Modulo 9 ArithmeticWith 9 Substituted for 0
 1 2 3 4 5 6 7 8 9 2 4 6 8 1 3 5 7 9 3 6 9 3 6 9 3 6 9 4 8 3 7 2 6 1 5 9 5 1 6 2 7 3 8 4 9 6 3 9 6 3 9 6 3 9 7 5 3 1 2 6 4 2 9 8 7 6 5 4 3 2 1 9 9 9 9 9 9 9 9 9 9