Skip to main content
1 of 2
isaacg
  • 42.1k
  • 5
  • 73
  • 213

#Pyth, 9 bytes

osjN2U^2Q

order by the sum of the base 2 representation (jN2) over the range (U) of 2 ^ Q.

(Q = eval(input())).

Try it here.

isaacg
  • 42.1k
  • 5
  • 73
  • 213