# Program to find N-th term of series 0, 9, 22, 39, 60, 85, 114, 147, …in C++

C++Server Side ProgrammingProgramming

In this problem, we are given a number N. Our task is to create a Program to find N-th term of series 0, 9, 22, 39, 60, 85, 114, 147, …in C++.

Problem Description − We are given the Series −

0, 9, 22, 39, 60, 85, 114, 147,....Nterms

To find the Nth term of this series, we will formula the general term of the series and then find the Nth term.

Let’s take an example to understand the problem,

Input − N = 6

Output − 85

## Solution Approach:

To find the general term of the series. Let’s observe the growth of the values of the series. It is a parabolic type of growth that means the general term would be quadratic. And upon further calculation, you can find the general term. The formula for the general term of series is −

TN = 2*(N^2) + 3*N - 5

## Program to illustrate the working of our solution,

#include <iostream>
using namespace std;
int findNTerm(int N) {

int nthTerm = ( (2*N*N) + (3*N) - 5 );
return nthTerm;
}
int main()
{
int N = 8;
cout<<N<<"th term of the series is "<<findNTerm(N);
return 0;
}

## Output:

8th term of the series is 147