N | Java program to find the N - th term in 1 , 11 , 55 , 239 , 991 , ... . ; Function to find the N - th term ; calculates the N - th term ; Driver Code
class GFG { static int numberSequence ( int n ) { int num = ( int ) ( Math . pow ( 4 , n ) - Math . pow ( 2 , n ) ) - 1 ; return num ; } public static void main ( String args [ ] ) { int n = 4 ; System . out . println ( numberSequence ( n ) ) ; } }