Powerful numerical tools for everyday use

Twenty-One Game

Strategy game where players aim to reach exactly 21

Twenty-One Game
You
0
Computer
0
Your turn
Choose a number to add to the total
0
21
0
Choose a number to add:
Game over! You win!
Move History
Turn Player Added Total

How to Play the Twenty-One Game

The Twenty-One Game is a mathematical strategy game where players take turns adding numbers to a running total. The player who reaches the target number exactly wins.

Game Rules:

  • Players take turns adding a number (1 to the maximum per turn) to the running total
  • The total starts at 0
  • The first player to reach exactly the target number (21 in classic play) wins
  • If a player causes the total to exceed the target, they lose

Winning Strategy:

The Twenty-One Game has a perfect mathematical strategy based on modular arithmetic and the concept of "winning positions".

The Winning Formula

For a target of 21 and maximum number of 3 per turn, the winning positions are:

Winning Positions = target - (max+1) * n
Where n = 0, 1, 2, 3, 4, 5, ...

For classic play (target 21, max 3), the winning positions are:
21, 17, 13, 9, 5, 1

If you can end your turn on one of these numbers, and play perfectly afterward, you will win.

Game Variations:

You can change the game by modifying:

  • Target Number: The final number players are trying to reach
  • Maximum Number Per Turn: The largest number a player can add on a single turn

Each variation has its own set of winning positions based on the formula above.

Mathematical Connection:

This game demonstrates concepts from combinatorial game theory and number theory. The winning strategy is based on modular arithmetic, specifically finding numbers that are congruent to 1 modulo (max+1).