N | CPP program to find Nth polite number ; function to evaluate Nth polite number ; driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; double polite ( double n ) { n += 1 ; double base = 2 ; return n + ( log ( ( n + ( log ( n ) / log ( base ) ) ) ) ) / log ( base ) ; } int main ( ) { double n = 7 ; cout << ( int ) polite ( n ) ; return 0 ; }