There are four pegs in a row; let's call them A, B, C, and D from left to right. Peg A has a stack of $n$ differently sized disks, sorted in size so the smallest disk is at the top. All other pegs are empty. The goal is to move all the disks to peg D, following the rules:
- You can move only one disk at a time.
- Disks can only be moved from the top of a stack to the top of another stack.
- You cannot put a larger disk over a smaller one.
- Once a disk leaves peg A, it cannot be moved back to peg A.
- You can move disks freely between pegs B, C, and D.
Describe an optimal (i.e. minimizing the number of steps) sequence of moves. What are the number of moves for $n=5$ and $n=6$?