fork download
  1. def check(x):
  2. while x:
  3. if (x&7) == 7: return False
  4. if (x&3) == 1: return False
  5. x >>= 1 + (x&1)
  6. return True
  7.  
  8. print([x for x in range(1, 200) if check(x)])
Success #stdin #stdout 0.02s 9068KB
stdin
Standard input is empty
stdout
[3, 6, 12, 24, 27, 48, 51, 54, 96, 99, 102, 108, 192, 195, 198]