The Tower of Hanoi has three pegs and one rule: never put a larger disc on a smaller one. Simple rule, exponential difficulty — n discs need 2^n - 1 moves, so 10 discs is already 1023 moves.

The alternating rule

There is a mechanical algorithm that solves any board without thinking about recursion:

  • The smallest disc moves every other move, always in the same direction — clockwise from peg A to C to B, or counter-clockwise depending on the parity of the disc count.
  • On the moves in between, exactly one legal move exists that does not involve the smallest disc. Play it.

That is the entire method. Because there is only ever one such move, you never have to choose.

For an even number of discs, the smallest disc starts by moving clockwise (A→C). For an odd number, it starts counter-clockwise (A→B).

Why this works

The puzzle's structure is recursive: to move n discs, you must first move n-1 discs out of the way, then move the largest, then move n-1 on top. The alternating rule encodes that recursion without you tracking it — the smallest disc's steady rotation *is* the recursion, expressed physically.

Think in powers, not moves

  • 3 discs: 7 moves.
  • 4 discs: 15 moves.
  • 5 discs: 31 moves.
  • 6 discs: 63 moves.

Every extra disc doubles the work plus one. That is why the game stops being fun around six discs and becomes a test of patience. It also means: if you are at move 40 on a 5-disc puzzle, you are not "almost done" — you have made an error and are now un-solving it.

Where players actually lose

  • Moving the smallest disc backwards. The whole method depends on the rotation staying consistent. One reversal and you are in a loop.
  • Trying to be clever in the middle game. There are no clever moves; there is exactly one legal non-smallest move at every step.
  • Losing count. Count your moves out loud. If a 4-disc puzzle takes 20 moves, you can stop and restart — you will finish faster.
Hanoi is not a puzzle you solve. It is a procedure you follow, and the discipline is not to improvise.

Recursion for humans

If you want the mental model rather than the rule: to move a stack of n from A to C, move n-1 to B, move the big one to C, then move n-1 from B to C. Do that on paper once and the alternating rule stops looking like magic.