Holiday gifts: shop the Gift Center and see our order-by dates. Free standard shipping on continental US orders over $99.

Tower of Hanoi: Learn the Pattern in Seven Moves

Creative Crafthouse Tower of Hanoi with wooden rings stacked on the centre peg of a three-peg box

Phil Janelle |

Updated October 6, 2026

Tower of Hanoi asks you to move a stack of rings from one peg to another, one ring at a time, without putting a larger ring on a smaller one. The shortest solution for n rings takes 2n - 1 moves. Start with three rings and you can see why that rule works.

Put three rings on the table and try moving the stack before reading the sequence. If you get stuck, watch what blocks the largest ring. The two smaller rings have to be moved together onto the spare peg before the largest can travel. That is the pattern this lesson makes visible.

Try three rings in seven moves

Name the pegs A, B and C, from left to right. Put all three rings on A with the largest underneath. Your destination is C. Each move lifts the top ring of a peg and places it on another peg.

Start

ABC

After move 3

ABC

After move 4

ABC

Complete

ABC
Three-ring A-to-C demonstration. Ring 1 is smallest; ring 3 is largest. The two-ring stack moves out of the way, the largest ring moves, then the two-ring stack returns.

A complete three-ring demonstration

  1. Smallest ring: A to C.
  2. Middle ring: A to B.
  3. Smallest ring: C to B.
  4. Largest ring: A to C.
  5. Smallest ring: B to A.
  6. Middle ring: B to C.
  7. Smallest ring: A to C.
Original teaching diagram by Creative Crafthouse. This classic sequence demonstrates the recursive pattern.

After move three, the two small rings are together on B. The largest ring is free to move to C. The last three moves put the small stack back on top of it. That middle move divides the whole solution into two smaller problems.

Explain the next move before making it

Try the same three-ring task again, this time saying which stack you are clearing and where it needs to go. If you can name the smaller task, you can work out the move instead of memorizing seven directions. Add a fourth ring only when you can explain the three-ring sequence.

Why the move count doubles, then adds one

To move a stack of n rings, first move the top n - 1 rings onto the spare peg. Move the largest ring once. Then move the small stack onto the largest ring. If T(n) is the shortest move count, that gives T(n) = 2T(n - 1) + 1. One ring needs one move, so two need three, three need seven, and the pattern continues.

This is recursion: the same task appears inside itself with one fewer ring. NIST's Dictionary of Algorithms and Data Structures gives the rules, minimum count and recursive method.

Rings Minimum moves A useful way to approach it
3 7 Follow the example and see the small-stack pattern.
5 31 Try the same method with a longer sequence.
7 127 Keep track of the destination and spare peg.
9 511 Allow for a much longer sequence, or start with a smaller subset.

Seven to nine rings multiplies the minimum moves by just over four. It does not add a new rule. The commitment is keeping the same rules straight over a longer sequence.

The rhythm you can use instead

There is an iterative method, too. Move the smallest ring every other move in a consistent direction around the pegs. Between those moves, make the only legal move that does not involve the smallest ring. It is important to say the only legal move, not the next-smallest ring: later in the sequence, a much larger ring must move.

For the three-ring A-to-C example, the smallest ring follows A, C, B, A, C. Its direction depends on your chosen destination and whether the ring count is odd or even. Define those first. If a move seems impossible, check the rules and current positions rather than forcing the pieces.

Where the puzzle came from

Édouard Lucas published the puzzle in 1883. The University of St Andrews MacTutor history distinguishes the puzzle from the legendary temple story associated with it. The story of monks moving a vast stack is a mathematical illustration, not evidence of an ancient origin.

It is still worth telling because the formula makes the scale tangible. Sixty-four rings require 18,446,744,073,709,551,615 moves in the shortest solution. A small rule repeated enough times produces an astonishingly large job.

Choosing a wooden set

Our Tower of Hanoi gives you a full stack and the option to practise with fewer rings. Choose a clear spot for the board and a separate place for unused rings, so your practice stack stays easy to follow. Check the current product page for what comes with the set.

For a shared session, our Hanoi challenge guide explains how to agree on rules and compare attempts fairly.

Questions before you choose

Can I put a ring on an empty peg?

Yes. The restriction is placing a larger ring on a smaller ring. An empty peg can accept any top ring.

Do I have to use the full stack?

No. Set the larger rings aside and try a smaller stack. The same rules apply.

Does the smallest ring always alternate with the middle ring?

No. It alternates with the only other legal move. That move can involve any larger ring.

Does nine rings mean a different puzzle?

The rules are identical. Nine rings have a minimum of 511 moves, compared with 127 for seven.