Find the Nth term in series 12 , 35 , 81 , 173 , 357 , ... | Java program to find the Nth term in series 12 , 35 , 81 , 173 , 357 , ... ; Function to find Nth term ; Nth term ; Driver code
class GFG { static int nthTerm ( int N ) { int nth = 0 , first_term = 12 ; nth = ( int ) ( ( first_term * ( Math . pow ( 2 , N - 1 ) ) ) + 11 * ( ( Math . pow ( 2 , N - 1 ) ) - 1 ) ) ; return nth ; } public static void main ( String [ ] args ) { int N = 5 ; System . out . print ( nthTerm ( N ) + "NEW_LINE"); } }