Tower of Hanoi Strategy: The Perfect Solution
1. The smallest disc sets the rhythm
Every second move is the smallest disc. Between two of its moves, there's exactly one legal move that doesn't involve it. Make that one.
2. Which way does the smallest disc go?
The smallest disc always moves in the same direction around the three pegs:
- Odd number of discs: first move it to the goal peg, and keep going left → right → middle → left...
- Even number: first move it to the middle peg, and keep going left → middle → right → left...
3. Think recursively
To move n discs from A to C: move the top n−1 to B, move the biggest to C, then move the n−1 from B to C. Each of those is the same puzzle, smaller.
4. Don't undo
If you ever move a disc back where it just came from, you've wasted two moves. The perfect solution never does.
Frequently asked questions
What is the trick to the Tower of Hanoi?
Every other move is the smallest disc, and it always circles the pegs in the same direction. Between its moves there's only one other legal move. Follow that and you finish in 2ⁿ−1 moves.
Last updated 2026-10-20