NIM ZERO

NIM ZERO · 2026.08.01-v1

Take-away 21 strategy: control multiples of four

In Take-away 21, take one token first to leave 20. After that, if the opponent removes x tokens, remove 4−x. Each pair of turns removes four, so you keep returning the pile to a multiple of four and take the last token.

The opening

Twenty-one is one more than a multiple of four, so remove one and leave 20. The opponent can take only 1, 2, or 3, and your reply of 3, 2, or 1 is always legal.

Why the invariant wins

The totals after your turns are 20, 16, 12, 8, 4, and 0. This is a subtraction game with a 1–3 move limit, not unrestricted multi-heap Nim; the complement-to-four rule is the relevant proof.

Worked position

TurnTakeRemaining
Opening121 → 20
Opponentx (1–3)20 − x
Your reply4 − x16
Your checkpoints20 → 16 → 12 → 8 → 4 → 0

Method and source

Method: finite legal moves are exhaustively checked by Nim Zero’s pure rules engine. Mathematical source: C. L. Bouton, “Nim, A Game with a Complete Mathematical Theory,” Annals of Mathematics, Second Series 3, no. 1/4 (1901–1902), 35–39.

DOI: 10.2307/1967631 · 2026-08-01

Back to the game