# Pyth, 9 bytes

    osjN2U^2Q

`o`rder by the `s`um of the base 2 representation (`jN2`) over the range (`U`) of `2 ^ Q`. 

(`Q` = `eval(input())`).

[Try it here.][1]


  [1]: http://pyth.herokuapp.com/