Question: how many different combinations can you make with four bits?
Answer: or, using shifts: (1 << i) - 1 for i in 0.. If yes, then you have 4! = 24 possible ways to choose which bits to flip first. So, this gives a total of 16*24 = 384 possible sequences that can be generated.