def is_hamming_numbers(x): if x == 1: return 1 if x % 2 == 0: return is_hamming_numbers(x/2) if x % 3 == 0: return is_hamming_numbers(x/3) if x % 5 == 0: