import mylib if __name__ == '__main__': m = 2 for n in range(2, 10**7 + 1): phi = mylib.totient(n) if sorted(str(n)) == sorted(str(phi)): r = n / phi if r < m: m = r print(n, phi, n / phi)
def is_hamming_brute(n): t = mylib.totient(n) dd = mylib.find_dividers(t, distinct=True) # print(n, t, max(dd)) return max(dd) < 6
import mylib if __name__ == "__main__": m = 2 for n in range(2, 10 ** 7 + 1): phi = mylib.totient(n) if sorted(str(n)) == sorted(str(phi)): r = n / phi if r < m: m = r print(n, phi, n / phi)