pub fn flip_bit(index: usize, pos: usize) -> usize
Compute the index with a bit flipped at the specified position