Tower of Hanoi: History, Rules & Math Concepts
The Tower of Hanoi was invented by French mathematician Édouard Lucas in 1883. He marketed it with a legend about monks moving 64 golden discs between diamond needles — a task that would take 2⁶⁴−1 moves, or roughly 585 billion years. The puzzle is fundamental in computer science as a textbook example of recursion and has applications in backup rotation schemes and neurological testing.
How to Play & Controls
Click or tap a peg to pick up its top disc, then click or tap another peg to place it. Only one disc may be moved at a time, and a larger disc may never be placed on top of a smaller disc. Your goal is to move the entire stack of 3 to 8 discs from the leftmost peg to the rightmost peg.
Math & Logic Concepts: The 2ⁿ − 1 Formula
The Tower of Hanoi teaches recursion and exponential growth. For n discs on 3 pegs, the minimum number of moves is always 2ⁿ − 1: 3 discs take 7 moves, 4 discs take 15 moves, and 8 discs take 255 moves. To solve n discs from peg A to peg C, recursively move n − 1 discs from A to B, move the largest disc from A to C, then move n − 1 discs from B to C. There is also a one-line iterative rule: on odd moves, move the smallest disc one peg clockwise; on even moves, make the only other legal move.
FAQ: Is Tower of Hanoi school-safe?
Yes — it is login-free, ad-free, and runs directly in any browser on Chromebooks, tablets, and phones. Teachers frequently use it in math and computer science classes to introduce recursion and proof by induction.