Tower of Hanoi
0 movesMove every disk to the right peg. No larger disk on a smaller one. How to solve
How to play the Tower of Hanoi
- The Tower of Hanoi is a puzzle with three pegs and a stack of disks. Move the whole stack from the left peg to the right peg.
- Move one disk at a time, and only the top disk of a peg. A larger disk can never go on top of a smaller one.
- Tap the peg with the disk you want to move, then tap the peg to move it to. You can also drag a disk. On a computer, the 1, 2 and 3 keys pick the left, middle and right pegs, and Ctrl+Z undoes a move.
- Choose from 3 to 10 disks. New to the puzzle? Start with 3 or 4 disks, and add one more each time you solve it in the fewest moves.
- The daily puzzle is one puzzle a day, the same for everyone: five disks scattered across the three pegs. Move them all to the right peg. The minimum number of moves changes from day to day. A new puzzle comes out every day at 15:00 UTC. Hints still count as a clear, but seeing the solution doesn’t.
- Stuck? “Hint” lights up the next move of the shortest solution from where you are. “Solve” moves the disks for you along the shortest solution (tap it again to stop). Rounds with hints or Solve don’t count toward your personal best. If you close the page, your game is saved so you can pick up where you left off.
Minimum number of moves
With n disks, the minimum number of moves is 2n − 1: 7 for 3 disks, 15 for 4, 31 for 5, 63 for 6, 127 for 7, 255 for 8, 511 for 9 and 1,023 for 10.
About the Tower of Hanoi
The Tower of Hanoi was invented by the French mathematician Édouard Lucas and first presented in 1883, as a game supposedly found by “N. Claus de Siam” (an anagram of Lucas d’Amiens). It came with a legend: in a temple in Benares, priests are moving the 64 golden disks of the Tower of Brahma, and when they finish, the world will end. Moving 64 disks takes at least 18,446,744,073,709,551,615 moves. At one move per second, that is about 585 billion years. Today the puzzle is a favorite in math and programming classes, and psychologists use it to study problem solving.