- 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 7, 21, 49, 91, 147, 217, …… in C++
In this problem, we are given a number n that denotes the nth term of the series. Our task is to create a program to find the N-th term of series 7, 21, 49, 91, 147, 217, …… in C++.
Problem Description - We will find the nth term of the series 7, 21, 49, 91, 147, 217, … and for that, we will deduce the general term of the series.
Let’s take an example to understand the problem,
Input − N = 5
Output − 147
Solution Approach:
Let’s deduce the general term of the given series. The series is −
7, 21, 49, 91, 147, 217, …
We can see that 7 is common here,
7 * (1, 3, 7, 13, 21, 31, ...)
Here, we can observe that this series is increasing like a square series. So,
Series: 7 * (12 , (22 - 1), (33 - 2), (42 - 3), (52 - 4), (62 - 5), ....)
The general term of the series can be generalized as −
Tn = 7*(n2 - (n-1))
Using the general term formula, we can find any value of the series.
For example,
T4 = 7*((4^2) - (4-1)) = 7(16 - 3) = 91 T7 = 7*((7^2) - (7-1)) = 7(49 - 6) = 301
Example
#include <iostream> using namespace std; int findNTerm(int N) { int nthTerm = ( 7*((N*N) - (N - 1)) ); return nthTerm; } int main() { int N = 9; cout<<N<<"th term of the series is "<<findNTerm(N); return 0; }
Output:
9th term of the series is 511
- Related Articles
- C++ program to find n-th term of series 3, 9, 21, 41, 71…
- 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 0, 9, 22, 39, 60, 85, 114, 147, …in C++
- C++ program to find n-th term of series 1, 3, 6, 10, 15, 21…
- C++ program to find n-th term in the series 7, 15, 32, …
- Program to find N-th term in the given series in C++
- Program to find N-th term of series 0, 2,1, 3, 1, 5, 2, 7, 3...in C++
- Program to find N-th term of series 0, 7, 8, 33, 51, 75, 102, 133...in C++
- Program to find N-th term of series 3, 6, 18, 24, … in C++
- 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++
- C Program for N-th term of Geometric Progression series
- C Program for N-th term of Arithmetic Progression series
- C++ program to find n-th term of series 2, 10, 30, 68, 130 …

Advertisements