fork(2) download
  1. f=lambda n:[int(bin(i+2**n)[:1:-1],2)//2for i in range(2**n)]
  2. for n in (0,1,2,3):
  3. print(f(n))
Success #stdin #stdout 0.03s 9984KB
stdin
Standard input is empty
stdout
[0]
[0, 1]
[0, 2, 1, 3]
[0, 4, 2, 6, 1, 5, 3, 7]