Program to find the Nth term of the series 0 , 5 , 18 , 39 , 67 , 105 , 150 , 203 , ... | CPP program to find the N - th term of the series : 0 , 5 , 18 , 39 , 67 , 105 , 150 , 203 , ... ; calculate Nth term of series ; Driver code
#include <iostream> NEW_LINE #include <math.h> NEW_LINE using namespace std ; int nthTerm ( int n ) { return 4 * pow ( n , 2 ) - 7 * n + 3 ; } int main ( ) { int N = 4 ; cout << nthTerm ( N ) ; return 0 ; }