text: Program to find Nth term of series 1 , 6 , 17 , 34 , 56 , 86 , 121 , 162 , ... ... . | C ++ program to find the N - th term of the series : 1 , 6 , 17 , 34 , 56 , 86 , 121 , 162 , ... . . ; calculate Nth term of series ; Driver code
code: #include <iostream> NEW_LINE #include <math.h> NEW_LINE using namespace std ; int nthTerm ( int n ) { return 3 * pow ( n , 2 ) - 4 * n + 2 ; } int main ( ) { int N = 4 ; cout << nthTerm ( N ) << endl ; return 0 ; }