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”

MovesWhat you do
1 to 15Move the top 4 disks to the middle pole
16Carry the largest disk, 5, to the right pole
17 to 31Move 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.

  1. 54321 Move 7 1 to the right
    3 disks are lined up on the right
  2. 54321 Move 8 4 to the middle
  3. 54321 Move 15 1 to the middle
    4 disks are lined up in the middle
  4. 43215 Move 16 5 to the right
  5. 32145 Move 23 1 to the left
    3 disks are lined up on the left
  6. 32154 Move 24 4 to the right
  7. 54321 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.

  1. 54321 Start
  2. 54321 Move 1 1 to the right
  3. 54321 Move 2 2 to the middle
  4. 54321 Move 3 1 to the middle
  5. 54213 Move 4 3 to the right
  6. 54123 Move 5 1 to the left
  7. 54132 Move 6 2 to the right
  8. 54321 Move 7 1 to the right
  9. 54321 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 1→right
  2. 2 2→middle
  3. 3 1→middle
  4. 4 3→right
  5. 5 1→left
  6. 6 2→right
  7. 7 1→right
  8. 8 4→middle
  9. 9 1→middle
  10. 10 2→left
  11. 11 1→left
  12. 12 3→middle
  13. 13 1→right
  14. 14 2→middle
  15. 15 1→middle
  16. 16 5→right
  17. 17 1→left
  18. 18 2→right
  19. 19 1→right
  20. 20 3→left
  21. 21 1→middle
  22. 22 2→left
  23. 23 1→left
  24. 24 4→right
  25. 25 1→right
  26. 26 2→middle
  27. 27 1→middle
  28. 28 3→right
  29. 29 1→left
  30. 30 2→right
  31. 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.

54321
Moves: 0 (fewest 31)

Move the whole tower from the left pole to the right pole. Tap a pole to pick up its top disk.