The object of Tower of Hanoi is to move all of the blocks to the left tower from the right tower in the least possible number of moves. A block cannot be placed ontop of a block that it is bigger than, and you can only move one block at a time.
The puzzle was invented by the French mathematician Edouard Lucas in 1883. There is a legend about an Indian temple which contains a large room with three time-worn posts in it surrounded by 64 golden discs. The priests of Brahma, acting out the command of an ancient prophecy, have been moving these disks, in accordance with the rules of the puzzle. According to the legend, when the last move of the puzzle is completed, the world will end. The puzzle is therefore also known as the Tower of Brahma puzzle. It is not clear whether Lucas invented this legend or was inspired by it.
If the legend were true, and if the priests were able to move discs at a rate of 1 per second, using the smallest number of moves, it would take them (264)-1 seconds or roughly 585 billion years. The universe is currently only about 13.7 billion years old.
There are many variations on this legend. For instance, in some tellings, the temple is a monastery and the priests are monks. The temple or monastery may be said to be in different parts of the world - including Hanoi, Vietnam, and may be associated with any religion. In some versions, other elements are introduced, such as the fact that the tower was created at the beginning of the world, or that the priests or monks may make only one move per day.