- 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. Our task is to create a program to Find Nth term of series 1, 4, 15, 72, 420…

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

N = 4

72

A simple approach to solve the problem is the formula for the Nth term of the series. For this, we need to observe the series and then generalise the Nth term.

The series can be seen as the product of factorial and a some variables,

1, 4, 15, 72, 420… 1!*(X1), 2!*(X2), 3!*(X3), 4!*(X4), 5!*(X5)... 1*(1), 2*(2), 6*(5/2), 24*(3), 120*(7/2)...

**Here, the series of product is,**

1, 2, 2.5, 3, 3.5… It is {(n+2)/2}.

So the formula of Nth term is

T(N) = ( N! * (N + 2)/ 2 )

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

#include <iostream> using namespace std; int calcFactorial(int N) { int factorial = 1; for (int i = 1; i <= N; i++) factorial = factorial * i; return factorial; } int calcNthTerm(int N) { return (calcFactorial(N) * (N + 2) / 2); } int main() { int N = 7; cout<<N<<"th term of the series is "<<calcNthTerm(N); return 0; }

7th term of the series is 22680

- Related Questions & Answers
- Program to find N-th term of series 2, 4, 3, 4, 15… in C++
- C++ program to Find Nth term of the series 1, 1, 2, 6, 24…
- C++ program to find Nth term of the series 1, 5, 32, 288 …
- C++ program to find Nth term of the series 1, 8, 54, 384…
- C++ program to find Nth number of the series 1, 6, 15, 28, 45, …..
- C++ program to find n-th term of series 1, 3, 6, 10, 15, 21…
- C++ program to find Nth term of the series 1, 6, 18, 40, 75, ….
- C++ program to find Nth term of the series 0, 2, 4, 8, 12, 18…
- C++ program to find nth Term of the Series 1 2 2 4 4 4 4 8 8 8 8 8 8 8 8 …
- C++ program to get the Sum of series: 1 – x^2/2! + x^4/4! -…. upto nth term
- Program to find N-th term of series 1 4 15 24 45 60 92... in C++
- C++ program to find n-th term in the series 7, 15, 32, …
- C++ program to find Nth term of the series 3, 14, 39, 84…
- C++ program to find Nth term of the series 5, 13, 25, 41, 61…
- C++ Program to find the sum of a Series 1/1! + 2/2! + 3/3! + 4/4! + …… n/n!

Advertisements