======================================================================== Subject: Gauss's formula ======================================================================== Gauss's "theorem" says: i=n SIGMA i = n(n+1)/2 i=1 i.e., 1 + 2 + ... + n = n(n+1)/2 Someone in class asked whether this formula holds when i starts at i=0. I said that it did, and I was correct, but... I also said that it would work for i starting at i=2, and, although there's a sense in which that's correct, there's a more important sense in which it isn't correct...and neither is the claim about i=0. To see what the formula really is, let's take a concrete case: The sum of the integers from 1 to 6 can be found using Gauss's trick as follows: 1+2+...+6 6+5+...+1 --------- 7+7+...+7 Then note that we have 6 7s, which is double the sum that we want, so we get: 6*7/2 = 21 = 1+2+...+6 Let's try the sum of the integers from 0 to 6: 0+1+2+...+6 6+5+4+...+0 ----------- 6+6+6+...+6 We have 7 6s, so we get 7*6/2 = 21. Note that it *looks* like the same formula as before. But looks can be deceiving. Let's try the sum of the integers from 2 to 6: 2+3+...+6 6+5+...+2 --------- 8+8+...+8 We have 5 8s, which is double the sum that we want, so we get: 5*8/2 = 20 = 2+...+6 Let's try the sum of the integers from 3 to 6: 3+4+5+6 6+5+4+3 ------- 9+...+9 That's 4 9s, so 4*9/2 = 18 = 3+4+5+6. Now let's look at the patterns we have: integer range formula ------------- ------- 0 to 6 7*6/2 1 to 6 6*7/2 2 to 6 5*8/2 (do you begin to see a pattern?) 3 to 6 4*9/2 I predict that the sum of the integers from 4 to 6 will be 3*10/2. (Try it.) How can we write that formula more generally? We know that Gauss's formula for the sum from 1 to 6 is 6(6+1)/2. In general, the sum from 1 to n (for any n) is n(n+1)/2. Note that the sum from 2 to 6 is (6-1)*(6+2)/2. And the sum from 3 to 6 is (6-2)*(6+3)/2. We can now see that the sum from 1 to 6 is really (6-0)*(6+1)/2. And the sum from 0 to 6 is really (6-(-1))*(6+0)/2. We can generalize: The sum of the integers from j to n (for any j,n) i.e., j + (j+1) + (j+2) + ... + n; i.e.: i=n SIGMA i i=j is (n-(j-1))*(n+j)/2. So, in particular, i=n SIGMA i = (n-(2-1))*(n+2)/2 = (n-1)(n+2)/2 i=2 Challenge: Use mathematical induction to prove that formula for 2+...+n. (Sounds to me like a wonderful final-exam problem :-)