- 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

# C++ program to find Nth term of the series 1, 5, 32, 288 …

In this problem, we are given an integer N. Our task is to create a program to Find Nth term of series 1,5, 32, 288 ...

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

## Input

N = 4

## Output

288

## Explanation

4^{th} term − (4^4) + (3^3) + (2^2) + (1^1) = 256 + 27 + 4 + 1 = 288

## Solution Approach

A simple approach to solve the problem is by using the general formula for the nth term of the series. The formula for,

Nth term = ( N^N ) + ( (N-1)^(N-1) ) + … + ( 2^2 ) + ( 1^1 )

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

## Example

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

## Output

8th term of the series is 5040

- Related Questions & Answers
- C++ program to find nth term of the series 5, 2, 13 41,...
- C++ program to Find Nth term of the series 1, 1, 2, 6, 24…
- C++ program to find Nth term of the series 5, 13, 25, 41, 61…
- C++ program to find Nth term of the series 1, 8, 54, 384…
- C++ program to find Nth term of the series 1, 6, 18, 40, 75, ….
- C++ program to find Nth term of series 1, 4, 15, 72, 420…
- 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…
- Program to find N-th term of series 0, 2,1, 3, 1, 5, 2, 7, 3...in C++
- Program to find Fibonacci series results up to nth term in Python
- C++ program to find Nth term of the series 0, 2, 4, 8, 12, 18…
- Find the Nth term of the series 9, 45, 243,1377…in C++
- JavaScript code to find nth term of a series - Arithmetic Progression (AP)
- C++ program to find the sum of the series (1*1) + (2*2) + (3*3) + (4*4) + (5*5) + … + (n*n)
- Program to find nth Fibonacci term in Python

Advertisements