1 |
8. p otherPeg(p; q)
9. otherPeg(p; q) q
1of(HanoiSTD(n-1 disks; from: p; to: otherPeg(p; q); indexing from: a)/m,s1.
HanoiSTD(n-1 disks; from: otherPeg(p; q); to: q; indexing from: m+1)/z,s2.
<z,HanoiHelper(n; s1; i.p; s2; i.q)/r1,r2. r1 @(m) r2>)
=
a+2 (2^(n-1))-1
 | 3 steps |