N | Java program for finding N - th polite number ; function to find N - th polite number ; driver code
import java . io . * ; class GFG { static double polite ( double n ) { n += 1 ; double base = 2 ; return n + ( Math . log ( ( n + ( Math . log ( n ) / Math . log ( base ) ) ) ) ) / Math . log ( base ) ; } public static void main ( String [ ] args ) { double n = 7 ; System . out . println ( ( int ) polite ( n ) ) ; } }