87
81*82/2= 3321
if (n%2==0) sum=n/2*(n+1); else sum=(n+1)/2*n;
Sum = 79*(79+1)/2 = 79*80/2 = 3160
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
They are: 79+2 = 81
The sum of -1 and -1 is -2.
3
To find the sum of the first 81 odd numbers, we can use the formula for the sum of an arithmetic series: Sn = n/2 * (2a + (n-1)d), where n is the number of terms, a is the first term, and d is the common difference. In this case, n = 81, a = 1 (first odd number), and d = 2 (since the difference between consecutive odd numbers is 2). Plugging these values into the formula, we get: S81 = 81/2 * (2(1) + (81-1)2) = 81/2 * (2 + 160) = 81/2 * 162 = 6561. Therefore, the sum of the first 81 odd numbers is 6561.