text: Sum of first n term of Series 3 , 5 , 9 , 17 , 33. ... | C ++ program to find sum of first n terms ; Sn = n * ( 4 * n * n + 6 * n - 1 ) / 3 ; Driver code ; number of terms to be included in sum ; find the Sn
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; int calculateSum ( int n ) { return ( pow ( 2 , n + 1 ) + n - 2 ) ; } int main ( ) { int n = 4 ; cout << " Sum ▁ = ▁ " << calculateSum ( n ) ; return 0 ; }