Find the count of numbers that can be formed using digits 3 , 4 only and having length at max N . | Java program to find the count of numbers that can be formed using digits 3 , 4 only and having length at max N . ; Function to find the count of numbers that can be formed using digits 3 , 4 only and having length at max N . ; Driver code
class GFG { static long numbers ( int n ) { return ( long ) ( Math . pow ( 2 , n + 1 ) ) - 2 ; } public static void main ( String args [ ] ) { int n = 2 ; System . out . println ( numbers ( n ) ) ; } }