if (n%2==0) sum=n/2*(n+1); else sum=(n+1)/2*n;
2
2
The sum of the numbers given is 31. 1 + 2 + 4 + 8 + ... + 2n = 2n+1 - 1
1+2+4 = 7
You add 1 plus another one and you get 2
The sum of -1 and -1 is -2.
87
5050
81*82/2= 3321
The mater is that if you do 1+1=2 then just add the sum with its self, so you have 2+2=4 and 4 is the answer
25