note
chipmunk
Here's an algorithm to find a solution using the shortest possible number of moves. It assumes that you know the proper order for the tapes, which you should, because figuring that out requires zero moves.
<p>
<ol>
<li>Starting at slot 1, find the first tape that is not in the right slot.
<li>Move that tape to slot 0.
<li>Since that tape was not in the right slot, there is another tape which belongs in that slot. Find that tape and move it into the right slot.
<li>Repeat the previous step until the tape in slot 0 is moved into the right slot.
</ol>
If there are N tapes that are not in the right slots, clearly each tape must be moved at least once, for a minimum of N moves. However, in order to move a tape, the destination slot must be empty, so one extra move is required to first move a tape into slot 0. Therefore, the above algorithm, which takes N+1 steps, finds a shortest solution.
144470
144470