Problema Solution
Use Gauss's approach to find the following sums
A. 1+2+3+4+...+999
B. 1+3+5+7+...+997
Answer provided by our tutors
А.
S = 1+2+3+4+...+999
S = (1 + 999) + (2 + 998) + ... + (499 + 501) + 500
S = 499*1000 + 500
S = 499,500
B.
S = 1+3+5+7+...+997
1 = 1 + 0*2
3 = 1 + 1*2
5 = 1 + 2*2
...
997 = 1 + 498*2
S = 498*1 + 2(1 + 2 + 3 + ...+498)
S = 498 + 2*(498/2)*499
S = 249,000