Use bitwise to calculate the n_iterations