Find the Nth term of the series 9 , 45 , 243 , 1377 | C ++ implementation of the approach ; Function to return the nth term of the given series ; nth term ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; long nthterm ( int n ) { int An = ( pow ( 1 , n ) + pow ( 2 , n ) ) * pow ( 3 , n ) ; return An ; } int main ( ) { int n = 3 ; cout << nthterm ( n ) ; return 0 ; }