the gauss's approach to find the following

1+2+3+4+... 99
1+3+5+7+...101

2 answers

try 1 to 5

1 + 2 + 3 + 4 + 5 = 15
that is five numbers
the middle one is 3 which is (1+5)/2

so try 1 to 99
that is 99 numbers
the middle one is (1+99)/2 = 50
so try 99*50 =100*50 - 99 = 4901
================================
try
1+3+5 = 9
which is 3 (1+5)/2 = 3*3
try
1+3+5+7 = 16
= (8/2)(8/2) = 16
try
1+3+5+7+9 = 25
=(10/2)(10/2)
try
1+3+5+7+9+11 = 36
= (12/2)(12/2)
so try
middle = 102/2 and number of them = 102/2
102^2/4 = 2601
99*50 = 4950