Tower of Hanoi

A model set of the Tower of Hanoi (with 8 disks)
An animated solution of the Tower of Hanoi puzzle for T(4, 3)
Tower of Hanoi interactive display at Mexico City's Universum Museum

The Tower of Hanoi (also called The problem of Benares Temple[1] or Tower of Brahma or Lucas' Tower[2] and sometimes pluralized as Towers, or simply pyramid puzzle[3]) is a mathematical game or puzzle consisting of three rods and a number of disks of various diameters, which can slide onto any rod. The puzzle begins with the disks stacked on one rod in order of decreasing size, the smallest at the top, thus approximating a conical shape. The objective of the puzzle is to move the entire stack to one of the other rods, obeying the following rules:[4]

  1. Only one disk may be moved at a time.
  2. Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack or on an empty rod.
  3. No disk may be placed on top of a disk that is smaller than it.

With three disks, the puzzle can be solved in seven moves. The minimal number of moves required to solve a Tower of Hanoi puzzle is 2n − 1, where n is the number of disks.

  1. ^ "A000225 - OEIS". oeis.org. Retrieved 2021-09-03.
  2. ^ Hofstadter, Douglas R. (1985). Metamagical Themas : Questing for the Essence of Mind and Pattern. New York: Basic Books. ISBN 978-0-465-04540-2.
  3. ^ Cohn, Ernst M. (1963). "A device for demonstrating some elementary properties of integers". The Mathematics Teacher. 56 (2). National Council of Teachers of Mathematics: 84. doi:10.5951/MT.56.2.0084. ISSN 0025-5769. Retrieved 9 March 2021.
  4. ^ Weisstein, Eric W. "Tower of Hanoi". mathworld.wolfram.com. Retrieved 2023-10-20.