

- 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
Find the Nth term of the series 9, 45, 243,1377…in C++
In this problem, we are given an integer value N.Our task is to Find the nth term of the series −
9, 45, 243, 1377, 8019, …
Let’s take an example to understand the problem,
Input : N = 4 Output : 1377
Solution Approach
A simple solution to find the problem is by finding the Nth term using observation technique. On observing the series, we can formulate as follow −
(11 + 21)*31 + (12 + 22)*32 + (13 + 23)*33 … + (1n + 2n)*3n
Example
Program to illustrate the working of our solution
#include <iostream> #include <math.h> using namespace std; long findNthTermSeries(int n){ return ( ( (pow(1, n) + pow(2, n)) )*pow(3, n) ); } int main(){ int n = 4; cout<<n<<"th term of the series is "<<findNthTermSeries(n); return 0; }
Output
4th term of the series is 1377
- Related Questions & Answers
- Program to find N-th term of series 9, 23, 45, 75, 113… in C++
- Find the Nth term of the series 2 + 6 + 13 + 23 + . . . in C++
- Find the nth term of the series 0, 8, 64, 216, 512,... in C++
- C++ program to find Nth number of the series 1, 6, 15, 28, 45, …..
- Find the Nth term of the series 14, 28, 20, 40,….. using C++
- C++ program to find nth term of the series 5, 2, 13 41,...
- Find the Nth term of the series 1 + 2 + 6 + 15 + 31 + 56 + … in C++
- 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 term of the series 3, 14, 39, 84…
- Find nth term of the Dragon Curve Sequence in C++
- C++ program to find Nth term of the series 1, 6, 18, 40, 75, ….
- 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…
- JavaScript code to find nth term of a series - Arithmetic Progression (AP)
Advertisements