Skip to content
Tyson Mao

Don't Say 21

A counting game you can teach in ten seconds and win forever after.

Two players count upward from 1, taking turns. On your turn you say either one number or two — so if the count is at 7, you may say “8” or “8, 9”, and then it is the other player's go.

Whoever is forced to say 21 loses.

It looks like a game of nerve, and it is not one. It is completely solved: one of the two players can win every single time, from the first move, no matter what the other does. The only question is which player, and whether they know it.

Play it a few times before reading on. Try to figure this out for yourself. I introduced this problem to my kids when they were four, and it took them several years, but they eventually got it.

Part one

Play it

You and the computer take turns counting up from 1. On your turn you say either one number or two. Whoever is forced to say 21 loses.

Play a few rounds before reading any further. The rule is findable, and finding it is much better than being told.

Opponent
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21

Nobody has said anything. Whoever says 21 loses.

The careless opponent moves at random until the count gets close, then plays properly. That is deliberate. A computer playing perfectly from the first move wins so cleanly that the pattern never has room to appear — you just lose, learn nothing, and stop. Playing loosely early leaves you space to notice which positions keep killing you.

It was Nim the whole time

Strip the counting away. There are twenty safe numbers between the start and the poisoned 21, and each turn removes one or two of them. Whoever takes the last safe number wins, because the other player has nothing left but 21.

That is a heap of twenty counters where you may take one or two — a single heap of Nim, in a costume. Which raises the obvious question: what happens with more than one heap?

Nim, with three heaps →