- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

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

In this problem, we are given an integer N. The task is to find the n-th term in series 1, 3, 6, 10, 15, 21, 28....

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

N = 7

28

The series is 1, 3, 6, 10, 15, 21, 28...

A simple solution to the problem is by finding the general term of the series. On observing the series we can see that the ith number of the series is the sum of (i-1)^{th} term and i.

This type of number is called triangular number.

To solve the problem, we will loop till n, and for each iteration add the current index with the last element’s value. At last return the Nth elements value.

**Program to illustrate the working of our solution,**

#include <iostream> using namespace std; int findNthTerm(int N) { int NthTerm = 0; for (int i = 1; i <= N; i++) NthTerm = NthTerm + i; return NthTerm; } int main() { int N = 8; cout<<"The "<<N<<"th term of the series is "<<findNthTerm(N); return 0; }

The 8th term of the series is 36

- Related Questions & Answers
- C++ program to find n-th term of series 3, 9, 21, 41, 71…
- Program to find N-th term of series 3, 6, 18, 24, … 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 1, 2, 11, 12, 21… in C++
- Program to find N-th term of series 2, 4, 3, 4, 15… in C++
- Program to find N-th term of series 0, 0, 2, 1, 4, 2, 6, 3, 8…in C++
- C++ program to find n-th term in the series 7, 15, 32, …
- Program to find N-th term of series 7, 21, 49, 91, 147, 217, …… in C++
- C++ program to find n-th term of series 2, 10, 30, 68, 130 …
- Program to find N-th term of series 1, 6, 17, 34, 56, 86, 121, 162, …in C++
- n-th term of series 1, 17, 98, 354…… in C++
- C++ program to Find Nth term of the series 1, 1, 2, 6, 24…
- Program to find N-th term of series 3, 5, 33, 35, 53… in C++
- Program to find N-th term of series 3, 12, 29, 54, 87, … in C++
- Program to find N-th term of series 1, 3, 12, 60, 360...in C++

Advertisements