As always with this problem, you need to think inductively. Start with the smallest possible tower to move, then ask yourself: If I can do that, how can I move a larger tower?
Since moving a tower of size one is trivial, let's start with a tower of size 2:
Base case
Moving a tower of size two one peg to the right:
| - | | |
| --- | | |
-------------------
Step 1:
| | | |
| --- | - | |
-------------------
Step 2:
| | | |
| --- | | - |
-------------------
Step 3:
| | | |
| | --- | - |
-------------------
Step 4:
| | | |
| - | --- | |
-------------------
Step 5:
| | - | |
| | --- | |
-------------------
This demonstrates how you can move the tower one peg to the right. Of course, this can also be used to move the tower from the second to the third, or from the third to the first peg.
Step
Let's say you know how to move a tower of size n one peg to the right, here's how you do it for n + 1 disks:
| - | | | Move the small tower one peg to the right
| --- | | |
| ----- | | |
| ------- | | |
-------------------------------
Step 1:
| | | | Move it another step to the right
| | - | |
| | --- | |
| ------- | ----- | |
-------------------------------
Step 2:
| | | | Let's move the n+1 disk one peg to the right
| | | - |
| | | --- |
| ------- | | ----- |
-------------------------------
Step 3:
| | | | Move the small tower to the right
| | | - |
| | | --- |
| | ------- | ----- |
-------------------------------
Step 4:
| | | | Move the small tower another peg to the right
| - | | |
| --- | | |
| ----- | ------- | |
-------------------------------
Final step:
| | - | |
| | --- | |
| | ----- | |
| | ------- | |
-------------------------------