- Related Questions & Answers
- Program to find N-th term of series 3, 12, 29, 54, 87, … 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 1 4 15 24 45 60 92... in C++
- C++ Programe to find n-th term in series 1 2 2 3 3 3 4
- 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 of series 1, 3, 6, 10, 15, 21…
- 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 3, 6, 18, 24, … in C++
- Program to find N-th term of series 0, 10, 30, 60, 99, 150, 210, 280...in C++
- 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++
- 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 0, 9, 22, 39, 60, 85, 114, 147, …in C++
- Program to find N-th term of series 0, 0, 2, 1, 4, 2, 6, 3, 8…in C++

- 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 a number N. Our task is to create a Program to find N-th term of series 1, 3, 12, 60, 360...in C++.

**Given Series**

1, 3, 12, 60, 360, 2520 … N Terms

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

**Input** − N = 6

**Output** − 2520

The general term formula for this one is a bit tricky. So, the increase in the series values is huge. So, there can be a few possibilities factorial or exponentials. So, we will first consider factorial, and on observing we can see the growth half as half of the factorial values. Also, the factorial of 2 is the first term here. So, the general formula would be,

**T _{N} = ((N+1)!)/ 2**

#include <iostream> using namespace std; int calcFact(int n){ if(n == 1){ return 1; } return (n*calcFact(n-1)); } int findNTerm(int N) { int nthTerm = ( (calcFact(N+1)) /2 ); return nthTerm; } int main() { int N = 8; cout<<N<<"th term of the series is "<<findNTerm(N); return 0; }

8th term of the series is 181440

Advertisements