How To Determine The Sum Of Your Values
Think of the values as the digits in a number and then compute your sum.
The number system we use is base 10, which means our digits are 0-9. We represent values with these digits based on how many unique digits they have. A digit that can be found once, like 2, is called a unit digit. If a digit can be found more than once in the same number, say 4 or 6, it’s called a tens digit (which would be equivalent to using two and five units respectively). When performing addition with these numbers it's important to remember that you're only adding one set of ones at first. Two examples to illustrate this principle:
Notice that one column in each of these tables represents a step of adding ones, whereas the other column represents the sum of digits. If you want to add 5 + 2, first you need to add 4 + 1. This is because two ones are added together to produce ten ones and four tens are added together to produce forty ones. Next, add one ten and one unit together: five ones and two units. Now you have the value 57 with five units left over, which we abbreviate as 57 = 5R (5 remainder). In this way we can determine the values in each column independently.
It's important to keep track of any remainders. One way to do this would be to write out the values and cross them out as you add them up, or use a calculator that rounds off numbers to the nearest hundredth and displays remainders as a percent. If your currency uses a base other than 10, the process is similar in concept. In binary you could display any remainders as ones places after the decimal point, or use negative numbers for positive remainder (if you are using exponents). When converting between base 10 and base 2, you need to do the opposite of what we did above. Convert each digit to its opposite for the digit based on how many times it appears in a given number. For example, if a number is 1 followed by 9, the ones place will represent 9 and the nine place would represent 1.
This is called representing a value by its digits. We are now ready to compute our sum by applying this procedure to any set of values you have.
If you have numbers with only a single digit, like 3 or 5, then first add up all of their unit digits (3 + 0 = 3 and 5 + 0 = 5). Then add up all the tens digits, ignoring any remainders in the process. The result of these steps is equal to the final sum.
For example, since 3 = 3 and 5 = 5 we can compute these two values without any remainder:
Now we can add up all of the numbers with two digits, wrapping around to include 1’s if necessary.
The order in which you perform addition is important with multi-digit numbers, but it is not entirely obvious why. The key idea is that if you start from left to right you are always performing addition on values that have already been added together before hand. In other words, if you are adding the sets of 5 digits
and 3 digits
then you will add them together in order starting at each right-most digit first (the place value system). This is because you are not adding together two new values, but re-combining an existing value into a new one. This can be done without writing down any intermediate values because the order in which we pick from each set of digits determines their whole sum and is reversible. Using this technique we can add up all of the pairs of numbers separated by a plus sign:
Next is the tricky part. We only have a few values left to combine, but they don't have ordered pairs anymore. Our goal is to recombine them into new values. By convention we'll combine them first in order from smallest to largest. The numbers are 1, 2, and 3 so we'll start there with the first value.
This is equivalent to re-combining the digits at each step as above. In this case we're starting at the leftmost digit of one number and adding it to the next digit in the other number (1 + 2 = 3). Add all of these steps together and you get a result which equals 6. We can now combine two more sets of two digits together in the same way:
Now our final sum should be equal to 8 (the units digit is 8 while all of our other digits are 10). The reason we can say this is because 8 = 1R + 1R = 1R + R. So here are the steps to determine the sum of any set of values:
For example, if you had 2,3,5,6,7 (written as 2R3R5R6R7), these would be the steps you would follow:
Notice that this final value is 6. What if there were six or more choices for our tens digits? For example:
We can break this down into 2 sums of 3 digits each (as in the above example) and then add up all 4 results together. This can be shown here with a table:
We have been working backwards in time and just realized that we can use the same technique to add up all of our other sums. So here are the final results for all of those sums:
Notice that these totals are equal to what we found earlier with our first example, 4 + 2 = 6. This is because both techniques will always give you the same answer. The only difference between one way and another is how we went about describing the values in order to determine their sum. If you are interested in looking up the result of any sum in this article, you should use the following table of values to pick the correct column:
As another example, suppose we want to sum up all of the two-digit numbers between 1 and 9. This can be done by picking one of the two-digit numbers in each column, adding its units digit with that column's number and then subtracting it out. The remaining digits can then be added together by applying this same principle. We can break this down into 5 steps each involving three figures:
The sum of all possible 2-digit numbers is 89536642880.
In this example, the value of each column is determined by adding together their digits and then summing their units place. For example, the units digit of 3 is 3, while the digits of 7 are 1-9. So as you can see, this procedure works by starting with a small set (3 + 7) and adding up all of its digits when determining the columns. The rest of it proceeds in much the same way as in our earlier examples. Since you are starting at the rightmost digit of each column, you do not need to carry any remainders over from one step to another like we did above in order to add up results.
Conclusion: In each column the sum is determined by adding up its digits and then subtracting its units digit. If you were to write it out step by step, the result would look something like this:
The sum of all possible two-digit numbers between 1 and 9 is 89536642880.
1) For example, for 65535 we want to calculate:
2) As in the previous article this can be done by first adding up all of the digits of the given number. This can be accomplished in a single step:
3) Also as in the previous article let's call this sum S(n).