sorting numbers based on the count of their bits