permutation-sequence: bit twiddling