The DigitSum Function

Let n it is in a number and let Dec10(n) it is in 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 higher than nine then the sum of that number"sdigits is computed until a solitary digit is ultimately 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 digit Sums for an analysis and evidence of this propositions.The proposition that DigitSum(x*y)=DigitSum(DigitSum(x)*y)) establishes that the sequences because that themultiples the 12 and also of 13 room the same as the sequences for 3 (1+2) and 4 (1+3), respectively.

You are watching: What is the sum of 4

Decimal depiction of Numbers

In order for the following to make feeling one have to stop reasoning of a number in terms ofits decimal representation and think of a number in regards to an appropriate number of tallymarks so 3 would be (|||) and also eleven (||||||||||||).Consider just how one obtains the decimal representation of a number. To get the critical digit onedivides the number by ten and takes the remainder as the last digit. The last digit is subtracted indigenous the number and also the result divided through ten. Then the decimal representation ofthat quotient is sought. The procedure is repeated and the next the critical digit is obtained.An alternating characterization the the process of recognize the decimal representation of a number is the the k-th power digit because that a entirety number n is:ck = (trunc)%10where trunc<> means the fractional component is thrown away and m%10 method the remainder afterdivision through 10. In terms of the terminology native the programming language Pascal theformula isck(n) = (n div 10k) mode 10The amount of the digits for a number n is thenSum = Σk ck(n),but this is not necessarily the digit sum for the number. The process has to it is in repeatediteratively ~ above the amount of the digits.

The Explanation of the fads of the Sequences

Consider 2 digits, a and also b. If their amount 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 also b is ten or an ext then the decimal depiction of their sum is a one inthe ten"s place and also (a+b−10) in the unit"s place. ThusDigitSum(a+b) = 1 + (a+b−10) = a+b−(10−1) = a+b−9For number the DigitSum(a)=a and also DigitSum(b)=b therefore DigitSum(DigitSum(a)+DigitSum(b)) = 1 + (a+b−10).Therefore for any two digits a and also bDigitSum(a+b) = DigitSum(DigitSum(a)+DigitSum(b)).This applies as fine to the number in the k-th place. Therefore the basic proposition forany two decimal depictions of numbers, x and also yDigitSum(a+b) = DigitSum(DigitSum(a)+DigitSum(b)).For differences, if a and also b room 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 to the digits in any 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 merely repeated addition it additionally 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 was previously provided that for any type of two number whose amount is greater 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 that DigitSum(x) is lessened to a single digit.Another method of express this is the the DigitSum for a number n is simply the remainder after division by 9; i.e., DigitSum(n)=(n%9). DigitSum arithmetic is simplyarithmetic modulo 9.For comparison 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 for this reason the very first column becomes the last column and also the first rowbecomes the last row the result would be identical to the table because that the order of digit sums.
000000000
The Rearrangement that the Multiplication Table for Modulo 9 ArithmeticWith 9 Substituted for 0
123456789
246813579
369369369
483726159
516273849
639639639
753126429
876543219
999999999

Some Proofs

The evidence of the home that the DigitSum of any multiple of nine is same to nine starts v the apparent propositionDigitSum(10*n) = DigitSum(n). From 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 way to know the sequence for 8 is that as soon as 8 is added to any type of digit except 0 or 1in any place the number is diminished by 2 and one added to the digit of the following place. Thisresults in a network decrease in the sum of digits of one. Thus when 8 is included to 8 the digitbecomes 6, a reduction of 2, and also 1 is included to the next higher digit, a net decrease in thesum of the number of 1. Thus added 8 come 8 outcomes in a sum of digits of 7. Including 8 come 7results in a amount of number of 6, and so on down to adding 8 come 1 which provides 9. Also this fits into the preeminence in the feeling that if 1 were minimize by 1 the an outcome would be 0 which is indistinguishable to 9 modulo 9. Likewise adding 7 come a number reduces that by 3 and also adds 1 come thedigit in the following place, a net reduction in the amount of number of 2. Therefore when 7 is included to 7the sum of digits is lessened to 5. When 7 is included to 5 the sum of number is lessened to 3.When 7 is added to 3 the sum of number is diminished to 1. If 7 is added to 1 the an outcome is 8,but that 8 can be think about as a reduction of 1 through 2 modulo 9. The enhancement of 7 to 8 resultsin a amount of digits of 6 and so on under to a amount of digits of 2. The addition of 7 come 2results in a amount of digits of 9, however that 9 can be considered 0 modulo 9 and thus that is a reduction of 2.

Generalization to other Number Bases

There is nothing special around 9; the is merely the number basic ten less one. The digitsum sequences for multiples in thehexadecimal (base 16) number device is:
NumberRepeating Cycleof amount 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, because that numbers of basic b the digit sums are identical to arithmetic modulo (b−1). The sequences i m sorry contain subsequences are the multiples of the factors of (b−1)other 보다 unity.In the instance of b=ten these factors are 3 and also 9. Because of this there space subsequences for 3,6,9.

See more: What Does My Heart Is Heavy Mean Ing Of A Heavy Heart In English

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