

// see http://en.wikipedia.org/wiki/Tower_of_Hanoi#Binary_solution
Although the threepeg version has a simple recursive solution as outlined above, the optimal solution for the Tower of Hanoi problem with four pegs (called Reve's puzzle), let alone more pegs, is still an open problem. 

