This is a dynamical system. The important idea here is that there are a finite number of states so the system must
eventually reach a state it has been in before and subsequently the states must change in a periodic cycle. It may
reach a steady (fixed) state or it may cycle through the same p states (where p > 1) in the same order over and over
again, a cycle of length p (a p-cycle). If the number of beads is a power of 2 then the system always reduces to a
steady state with all red beads whatever the initial state but the proof is rather subtle.