Tower of Hanoi, the recursive idea
Let assume initially we have n disks on peg A, no disks on B, or C, the aim is to move from all disks in A to B, with the help of spare peg C.
Suppose that we can solve the n-1 disks Tower of Hanoi problem.
Use the above n-1 disk method to move the n-1 to peg C, the spare.
Move the last largest disk on peg A to its final destination B.
Use again the same n-1 solution to move the n-1 disks from the spare C back to B.