def check(x): while x: if (x&7) == 7: return False if (x&3) == 1: return False x >>= 1 + (x&1) return True print([x for x in range(1, 200) if check(x)])
Standard input is empty
[3, 6, 12, 24, 27, 48, 51, 54, 96, 99, 102, 108, 192, 195, 198]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!