set N form i to j with M
next smallest and prev largest with same num of 1 bits
number of bits to convert
swap odd and even bits