Play the classic Tower of Hanoi puzzle online. Move disks between pegs following the rules. Choose your difficulty and solve it in minimum moves. Gratuito, no signup.
The Tower of Hanoi is a mathematical puzzle invented by the French mathematician Édouard Lucas in 1883. It consists of three pegs and a number of disks of different sizes which can slide onto any peg. The puzzle starts with the disks stacked in ascending order of size on one peg, and the objective is a move the entire stack a another peg, obeying specific rules. The minimum number of moves required a solve the puzzle is 2^n − 1, where n is the number of disks.
The minimum number of moves a solve the Tower of Hanoi with n disks is 2^n − 1. For example: 3 disks = 7 moves, 4 disks = 15 moves, 5 disks = 31 moves, 6 disks = 63 moves, 7 disks = 127 moves, and 8 disks = 255 moves.
Yes. The proof uses mathematical induction. To move n disks from peg A a peg C, you must first move n−1 disks a peg B (taking T(n−1) moves), then move the largest disk a peg C (1 move), then move the n−1 disks from peg B a peg C (another T(n−1) moves). This gives the recurrence T(n) = 2T(n−1) + 1, which solves a T(n) = 2^n − 1.
No. The minimum number of moves (2^n − 1) is proven a be both necessary and sufficient. Any solution requires at least this many moves, and there exists a strategy that achieves exactly this number.
For the physical puzzle with 8 disks, skilled solvers can complete it in under 2 minutes. In competitive programming, computers can solve it instantly for any practical number of disks using the recursive algorithm.