- 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

# N-th term in the series 1, 11, 55, 239, 991,…in C++

The given series is 1, 11, 55, 239, 991...

If you clearly observe the series, you will find that the n-th number is 4^{n}-2^{n-1}.

## Algorithm

- Initialise the number N.
- Use the series formula to compute the n-th term.
- Print the result.

## Implementation

Following is the implementation of the above algorithm in C++

#include <bits/stdc++.h> using namespace std; int getNthTerm(int n) { int num = pow(4, n) - pow(2, n) - 1; return num; } int main() { int n = 7; cout << getNthTerm(n) << endl; return 0; }

## Output

If you run the above code, then you will get the following result.

16255

- Related Questions & Answers
- Program to find N-th term of series 1, 2, 11, 12, 21… in C++
- n-th term of series 1, 17, 98, 354…… in C++
- n-th term in series 2, 12, 36, 80, 150….in C++
- Program to find N-th term of series 0, 11, 28, 51, 79, 115, 156, 203, …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 …
- C++ program to find n-th term of series 1, 3, 6, 10, 15, 21…
- Program to find N-th term of series 1, 6, 17, 34, 56, 86, 121, 162, …in C++
- Find sum of Series with n-th term as n^2 - (n-1)^2 in C++
- Program to find N-th term of series 7, 21, 49, 91, 147, 217, …… in C++
- Program to find N-th term of series 3, 6, 18, 24, … in C++
- Program to find N-th term of series a, b, b, c, c, c…in C++
- Program to find N-th term of series 0, 0, 2, 1, 4, 2, 6, 3, 8…in C++
- 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++

Advertisements