n=2**input()exec'print int(bin(n)[:1:-1],2)/2;n+=1;'*n
3
0 4 2 6 1 5 3 7
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!