Store all the values of phi ( x ) upto 10 ^ 5 with frequencies
Dictionary < int , int > mp = new Dictionary < int , int > ( ) ; for ( i = 1 ; i < 100000 ; i ++ ) { if ( mp . ContainsKey ( phi ( i ) ) ) { mp [ phi ( i ) ] = mp [ phi ( i ) ] + 1 ; } else { mp . Add ( phi ( i ) , 1 ) ; } } i = 1 ; while ( count < n ) {