+ 2
Help me solve this: Sum= 1+2+3+4+...+100
7 ответов
+ 5
(100 + 1) * 50
Gauss was great!
+ 4
Why don't you try it yourself, and post the code if you have trouble? We'll be here to help. 😉
+ 4
try this, hope it helps
i = 1
sum = 0
while i ≤ 100:
sum += i
print(sum)
+ 3
i'll try, thanx @blackcat1111
+ 3
1+100=101
2+99=101
and so on untill 50+51=101
so...
50*101
+ 3
use the sum of arithmetic progression :
Sn = n*(2*a+(n-1)*d)/2
For your question
n = 100
a = 1
d = 1
Therefore :
Sn = 100*(2+99)/2
= 50*101
= 5050
Thus the sum is : 5050