text: Find the Nth term of the series 1 + 2 + 6 + 15 + 31 + 56 + ... | C ++ program to find Nth term of the series : 1 + 2 + 6 + 15 + 31 + 56 + ... ; calculate Nth term of given series ; Driver code
code: #include <iostream> NEW_LINE #include <math.h> NEW_LINE using namespace std ; int Nth_Term ( int n ) { return ( 2 * pow ( n , 3 ) - 3 * pow ( n , 2 ) + n + 6 ) / 6 ; } int main ( ) { int N = 8 ; cout << Nth_Term ( N ) ; }