Chinese Rings
The first ring can always be put on or taken off. Any other ring moves only when the ring just before it is on and every ring before that is off. Clear them all and you will see how the move count is tied to binary numbers.
Tap rings to put them on or take them off, and watch the binary readout.
How to play
Tap a ring to put it on or take it off. You can move ring 1 at any time, and any other ring only when the ring just before it is on and every ring before that is off. Tap a ring that cannot move and the reason appears. Take every ring off to finish. Choose the number of rings from the menu above.
Learn more
For n rings that all start on, the fewest moves to take them all off is 1, 2, 5, 10, 21, 42, 85, 170 and 341 for n = 1 to 9: the integer part of 2 to the power n+1, divided by 3. Breadth-first search confirms every value (nine rings need 341 moves). Write each ring as 1 (on) or 0 (off) and the solution walks through the Gray code, where neighbouring patterns differ in exactly one digit. Read your current pattern as a Gray code, convert it to ordinary binary, and you get exactly the number of moves still needed. The tests check this for every pattern.