How to Calculate the Sum of N Numbers
Calculating the sum of a series is a simple process when the series is short. Suppose that you are asked to calculate the sum of first three integers. In this case, N is equal to 3 and the sum equals 6. However, for a longer series, adding up each number one by one becomes a lengthy and tedious process. Suppose that you are asked to find out the sum of first 100 integers. In this case, the problem is:
1 + 2 + 3 + 4 + 5 + 6 + 7 +...+ 99 + 100 =?
The famous mathematician Gauss was asked to do this, so the story goes, in his elementary school class. While the rest of the children were busy counting, Gauss rearranged the numbers as:
(1+100) + (2+99) + .... + (50+51).
It is easy to see that each pair adds up to 101. Since there are 50 pairs, the sum is 50 * 101, which is equal to 5050. Expressed as a formula, the sum of N numbers is equal to (1+N) * N/2.
Instructions
-
-
1
Determine N, the number of elements in the series. For example, suppose you want to calculate the sum of the numbers 1 to 10. N in this case is 10.
-
2
Multiply N by N+1. For the first 10 numbers, the product 10 * 11 equals 110.
-
-
3
Divide the product in Step 2 by 2 to calculate the sum of the N numbers. In our example, the total is now 110 divided by 2, which equals 55.
-
1
References
Resources
- Photo Credit Stockbyte/Stockbyte/Getty Images