- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Program to find N-th term of series 3, 12, 29, 54, 87, … in C++

In this problem, we are given a number N. Our task is to create a program to find N-th term of series 3, 12, 29, 54, 87, … in C++.

The series is

3, 12, 29, 54, 87, 128, .... N-Terms

## Let’s take an example to understand the problem,

**Input** − N = 5

**Output** − 87

## Solution Approach:

Let’s deduce the general term of the given series. The series is −

**3, 12, 29, 54, 87, 128, ....**

The general term of this series is

**T _{n} = 4(n^{2} ) - 3*n + 2**

Using the general term formula, we can find any value of the series.

**For example,**

T_{8}= 4*(8^{2}) - 3*8 + 2 T_{8}= 234

## Example

#include <iostream> using namespace std; int findNTerm(int N) { int nthTerm = ( (4*N*N) - (3*N) + 2 ); return nthTerm; } int main() { int N = 7; cout<<N<<"th term of the series is "<<findNTerm(N); return 0; }

## Output:

7th term of the series is 177

- Related Articles
- Program to find N-th term of series 3, 12, 29, 54, 86, 128, 177, 234, ….. in C++
- Program to find N-th term of series 1, 3, 12, 60, 360...in C++
- Program to find N-th term of series 1, 2, 11, 12, 21… in C++
- Program to find N-th term of series 3, 6, 18, 24, … in C++
- C++ program to find n-th term of series 3, 9, 21, 41, 71…
- Program to find N-th term of series 2, 4, 3, 4, 15… in C++
- Program to find N-th term of series 3 , 5 , 21 , 51 , 95 , … in C++
- Program to find N-th term of series 3, 5, 33, 35, 53… in C++
- C++ program to find n-th term of series 1, 3, 6, 10, 15, 21…
- Program to find N-th term in the given series in C++
- Program to find N-th term of series 2, 12, 28, 50, 77, 112, 152, 198, …in C++
- Program to find N-th term of series 0, 2,1, 3, 1, 5, 2, 7, 3...in C++
- C++ program to find n-th term in the series 7, 15, 32, …
- C++ program to find n-th term in the series 9, 33, 73,129 …
- Program to find N-th term of series a, b, b, c, c, c…in C++

Advertisements