A puzzle with a legend attached
The Tower of Hanoi was introduced by French mathematician Γdouard Lucas in 1883, reportedly accompanied by a legend about monks moving 64 golden disks and a prophecy that the world would end once they finished. With 64 disks the minimum-move count is over 18 quintillion, which at one move per second would take roughly 585 billion years β a fittingly dramatic illustration of exponential growth.
Why the recursive strategy always works
The recursive approach works because the rules of the puzzle never actually care how a smaller sub-stack got positioned on a peg, only that it is in valid descending order. That means any method that correctly relocates nβ1 disks can be reused, unchanged, as a building block for solving n disks, which is exactly why the same simple three-step pattern scales to any number of disks.
Frequently Asked Questions
Why is 2^n β 1 the minimum and not just an estimate?
It can be proven that moving the bottom (largest) disk requires first clearing all nβ1 disks above it to a single other peg, and after moving it, those nβ1 disks must be moved again onto it β meaning the move count for n disks is always exactly twice the count for nβ1 disks, plus one move, which works out mathematically to 2^n β 1.
Does the starting and target peg affect the number of moves needed?
No. The minimum move count depends only on the number of disks, not on which peg you start from or which peg is the target β the formula 2^n β 1 holds regardless of the specific pegs chosen.