5050
303
Sum = 79*(79+1)/2 = 79*80/2 = 3160
The sum of the numbers given is 31. 1 + 2 + 4 + 8 + ... + 2n = 2n+1 - 1
The sum of -1 and -1 is -2.
It is 100*(100+1)/2 = 50500.
1+2+3+4.....+100 = 101*50= 5050
303
The sum of the numbers up to 100 is equal to (100 x 101)/2 = 5050
Sum of numbers from 1 to 100:(1+100) + (2+99) + (3+98) + (4+97) + ... + (49+52) + (50+51) =50 pairs, each pair adds up to 101= (50 x 101)= 5,050
2*100 = 200 12*10 = 120 14*1 = 14 Sum = 334
You add the numbers in a loop. Here is an example in Java:int sum = 0;for (int i = 1; i
if (n%2==0) sum=n/2*(n+1); else sum=(n+1)/2*n;
Sum = 79*(79+1)/2 = 79*80/2 = 3160
The sum of these composite numbers, including 100, is 3989.The sum of all numbers between 1 and 100 is 5,050. From this we need to subtract the sum of 1 plus all the prime numbers below 100. The sum of the primes is 1,060. Subtracting (1 + 1060) or 1,061 from 5,050 yields 3,989.
2
2
1+2+4 = 7