The Tower of Hanoi with 5 disks takes at least 31 moves. Memorizing 31 moves one by one is hard, but if you think in parts, it is just the 4-disk solution (15 moves) twice, with one move in the middle. This article explains how to move the tower from the left pole to the right pole. The disks are numbered 1 to 5, from smallest to largest.
With 5 Disks, Start by Moving to the Right
5 is an odd number, so on the first move you put the smallest disk (1) straight onto the right pole (the one you want to move to). After that:
- On odd-numbered moves, move disk 1 to the next pole in the order “left → right → middle → left…“.
- On even-numbered moves, make the only move available that does not involve disk 1.
Just keep repeating them. (The reason is explained in the article on how to solve it.)
31 Moves Is “15 Moves, 1 Move, 15 Moves”
| Moves | What you do |
|---|---|
| 1 to 15 | Move the top 4 disks to the middle pole |
| 16 | Carry the largest disk, 5, to the right pole |
| 17 to 31 | Move the 4 disks on the middle pole to the right pole |
The first 15 moves split further into “3 disks to the right (7 moves), 4 to the middle (1 move), 3 disks to the middle (7 moves)“. The second half has the same shape.
Checkpoint Positions
This is the position after each checkpoint move. Compare your board with these positions and you can tell right away whether you are on track.
- Move 7 1 to the right
3 disks are lined up on the right - Move 8 4 to the middle
- Move 15 1 to the middle
4 disks are lined up in the middle - Move 16 5 to the right
- Move 23 1 to the left
3 disks are lined up on the left - Move 24 4 to the right
- Move 31 1 to the right
Done
Every 8 moves (moves 8, 16 and 24), a large disk (4 or 5) moves. On the move just before, 7, 15 and 23, the small disks always form a single tower.
The First 8 Moves in Diagrams
The first 8 moves finish “the tower of 3 to the right” and “4 to the middle”. If you get this far, the rest repeats the same idea.
- Start
- Move 1 1 to the right
- Move 2 2 to the middle
- Move 3 1 to the middle
- Move 4 3 to the right
- Move 5 1 to the left
- Move 6 2 to the right
- Move 7 1 to the right
- Move 8 4 to the middle
All 31 Moves
“3 to the middle” means moving disk 3 to the middle pole. The bold moves are the ones that move the largest disk, 5.
See all 31 moves (5 disks, left → right)
- 1 1→right
- 2 2→middle
- 3 1→middle
- 4 3→right
- 5 1→left
- 6 2→right
- 7 1→right
- 8 4→middle
- 9 1→middle
- 10 2→left
- 11 1→left
- 12 3→middle
- 13 1→right
- 14 2→middle
- 15 1→middle
- 16 5→right
- 17 1→left
- 18 2→right
- 19 1→right
- 20 3→left
- 21 1→middle
- 22 2→left
- 23 1→left
- 24 4→right
- 25 1→right
- 26 2→middle
- 27 1→middle
- 28 3→right
- 29 1→left
- 30 2→right
- 31 1→right
Try 5 Disks
The board below starts with 5 disks. See if you can finish in 31 moves. The easiest level (1 star) of “Puzzles” in the Tower of Hanoi app also uses 5 disks.
