Program to find the Nth term of the series 0 , 5 , 14 , 27 , 44 , ... ... . . | CPP program to find N - th term of the series : 0 , 5 , 14 , 27 , 44 . . . ; Calculate Nth term of series ; Driver code
#include <iostream> NEW_LINE #include <math.h> NEW_LINE using namespace std ; int nthTerm ( int n ) { return 2 * pow ( n , 2 ) - n - 1 ; } int main ( ) { int N = 4 ; cout << nthTerm ( N ) ; return 0 ; }