Origin, Rules and Minimum steps to solve
The tower of Hanoi (also known as the "towers of Hanoi"), is a puzzle invented by E. Lucas in 1883.

Configuration consist in 3 pegs. At first peg we stack n disks, from largest on the bottom to smallest on top.
The puzzle asks for the minimum number of moves required to move the stack from current peg to another.


Rules of puzzle are two:
(1) Move disks one by one.
(2) Always one disk should go on a bigger one.


Minimum moves are 2^n - 1 where n is the number of disks.
Program and ScreenShot
Program uses a formula based on a sequential algorithm I developed on 1981. Given disk number and step, formula returns the number of peg where disk should be placed or found  :

P = F(D, S)           P = peg (1, 2 or 3)
                              D = disk number (1 to n)
                              S = step (1 to 2^n - 1).

This algorithm has a minimum requeriment of computer memory : 3 * n * m + K where n is the number of disks, m size of integer variables and K is the amount of memory used by program control varibles (independent of number of disks).
Last updated 2010 / 02 / 13
Notes :
Maximum number of disks is dependent of screen resolution and height of window program.
You can download program here, decompress anywhere and run.
Click image to enlarge.
When sending mail preserve propossed start subject