Recursively move a stack of disks between pegs using an auxiliary peg.
Step 1 of 64
Tower of Hanoi with 5 disks. Move all disks from peg A to peg C using peg B as auxiliary. Minimum moves required: 31.
Peg State
How It Works
To move n disks from A → C: move n−1 disks from A → B, move disk n to C, then move n−1 disks from B → C. This gives T(n) = 2n − 1 moves.