In the standard Towers of Hanoi problem, you have three poles: the first has a pyramid of
n disks, and the other two are empty. Your task is to move the disks to the third pole, with the restriction that you can move one disk at a time, never putting a larger disk on top of a smaller one.
How many moves would this task take, if ALL moves had to be either to or from the middle pole? (Thus, you cannot move a disk directly from the first pole to the third one, or viceversa.)
If the number of disks is n, then the required number of moves is given by
S(n) = 2 * [S U M ] 3^(x-1), where n > 0
x= 0 to n
Edited on December 31, 2022, 2:22 am