Tower of Hanoi, the dance of minimum movement

Image by BehindTheTmuna retrieved from Unsplash

The Tower of Hanoi is one of the most iconic mathematical and computational puzzles in history. It was invented in 1883 by the French mathematician Édouard Lucas, who accompanied it with a mythical lore: the Legend of the Temple of Benares.

According to the story, the priests of the temple guard three diamond needles with 64 golden disks of varying sizes. Their task is to transfer the entire tower from the first needle to the third following strict, unalterable sacred rules. It is said that when the last move is completed, the temple will crumble and the end of the world will arrive.

Behind this mystical narrative lies a fascinating mathematical structure based on recursion, state combinatorics, and exponential growth.

Formal problem description

The game consists of 3 vertical rods (labeled A, B, and C) and a set of $n$ disks of decreasing diameters initially stacked on rod A (source), ordered from largest at the base to smallest at the top.

The goal is to transfer the entire stack of disks from the source rod A to the destination rod C, abiding by the following rules:

  1. Only one disk can be moved at a time.
  2. A move consists of taking the top disk from one of the rods and placing it on top of another rod or on an empty rod.
  3. No disk may ever be placed on top of a smaller disk.

To analyze the properties of this game, we will focus on the case of $n = 3$ disks:

Do you know what is the minimum number of moves required to complete the game with 3 disks and how to perform the perfect sequence?


The Tower of Hanoi can also be modeled using a binary optimization formulation. Do you dare to try modeling it?


Want to keep exploring the world of Operations Research? Discover more posts on the topic here.




If you found this useful, please cite this as:

Martín-Campo, F. Javier (Sep 2026). Tower of Hanoi, the dance of minimum movement. https://www.fjmartincampo.com/blog/2026/towerhanoi/.

or as a BibTeX entry:

@misc{martín-campo2026tower-of-hanoi-the-dance-of-minimum-movement,
  title   = {Tower of Hanoi, the dance of minimum movement},
  author  = {Martín-Campo, F. Javier},
  year    = {2026},
  month   = {Sep},
  url     = {https://www.fjmartincampo.com/blog/2026/towerhanoi/}
}



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • A crime has been committed... in a sudoku!
  • The harmony of digits in solving Kakuro
  • Killer Sudoku, the empty board challenge that math can solve
  • Solving the Number Sums board using mathematical optimization
  • Building bridges with linear optimization, the Hashi puzzle