
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
Program to find N-th term of series 4, 14, 28, 46, 68, 94, 124, 158, …..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 4, 14, 28, 46, 68, 94, 124, 158, …..in C++.
Problem Description − To find the Nth term of series
4, 14, 28, 46, 68, 94, 124, … (N-terms),
We will find the general term of the series and calculate the value based on the value of n.
Let’s take an example to understand the problem,
Input − N = 5
Output − 68
Solution Approach:
Let’s deduce the general term of the given series. The series is:
4, 14, 28, 46, 68, 94, 124….
We have 2 in common for all elements.
Series: 2(2, 7, 14, 23, 34, ….) = 2((12 + 1), (22 + 3), (32 + 5), (42 + 7), (52 + 9) ….) = 2((12 + (2-1)), (22 + (4-1)), (32 + (6-1)), (42 + (8-1)), (52 + (10-1)) ….) = 2((12 + ((2*1)-1)), (22 + ((2*2)-1)), (32 + ((2*3)-1)), (42 + ((2*4)-1)), (52 +((2*5)-1)) ….)
The general term of the series can be generalized as −
Tn = 2*(n2 + (2*n-1))
Using the general term formula, we can find any value of the series.
For example,
T6 = 2*(62 + (2*6 - 1)) = 2*(36 + (12 -1 )) = 2*(36 + 11) = 2*(47) = 94
Example
#include <iostream> using namespace std; int findNTerm(int N) { int nthTerm = ( 2*((N*N) + ((2*N) - 1)) ); return nthTerm; } int main() { int N = 11; cout<<N<<"th term of the series is "<<findNTerm(N); return 0; }
Output:
11th term of the series is 284
- Related Articles
- C++ program to find n-th term of series 2, 10, 30, 68, 130 …
- Program to find N-th term of series 2, 4, 3, 4, 15… in C++
- Program to find N-th term of series 0, 11, 28, 51, 79, 115, 156, 203, …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 in the given series in C++
- C++ program to find n-th term of series 1, 4, 27, 16, 125, 36, 343...
- Program to find N-th term of series 1 4 15 24 45 60 92... 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 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++
- 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 3, 9, 21, 41, 71…
- Program to find N-th term of series 3, 5, 33, 35, 53… in C++

Advertisements