Find the Nth term of the series 9 , 45 , 243 , 1377 | Java implementation of the approach ; Function to return the nth term of the given series ; nth term ; Driver code
import java . util . * ; import java . lang . * ; import java . io . * ; public class GFG { static int nthTerm ( int n ) { int An = ( ( int ) Math . pow ( 1 , n ) + ( int ) Math . pow ( 2 , n ) ) * ( int ) Math . pow ( 3 , n ) ; return An ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . println ( nthTerm ( n ) ) ; } }