Store all the values of phi ( x ) upto 10 ^ 5 with frequencies
mp = dict ( ) NEW_LINE i = 1 NEW_LINE while i < 100000 : NEW_LINE INDENT tmp = phi ( i ) NEW_LINE if tmp not in mp : NEW_LINE INDENT mp [ tmp ] = 0 NEW_LINE DEDENT mp [ tmp ] += 1 ; NEW_LINE i += 1 NEW_LINE DEDENT i = 1 NEW_LINE while ( count < n ) : NEW_LINE