I can't grasp the underlying process on how this is working. n/2(f+l) = algorithm sum of all integers n= number of all integers f= first integer l= last integer Example: 1, 2, 3, 4 4/2(1+4) 2(5) = 10 I know how to do it, but I don't really understand how to actually do it. Am I just too stupid? Why do I need to split the sum of all integers? Why am I adding the first + last integer? Why when I times them together does it work? How did he create the algorithm for this?
In order to see how this works, write down the string of integers in two different ways: Code (Text): 1 2 3 4 5 6 7 8 9 10 10 9 8 7 6 5 4 3 2 1 What do you notice about the sum of each column of numbers?
What Gauss did (according to the usual story) was to pair off the numbers like this. Suppose you want to sum the 9 numbers 7 8 9 10 11 12 13 14 15 7 + 15 = 22 8 + 14 = 22 9 + 13 = 22 10 + 12 = 22 11 = 22/2 So the sum = (9/2)(22) = (9/2)(7+15)