Variants
Tower of Hanoi Variants
Change one thing about the puzzle — a tower, a direction, a colour, a starting position — and the answer changes out of all proportion. Five boards, all playable.
Every board below uses the three rules you already know: one disk at a time, only the top disk of a tower, and never a larger disk onto a smaller one. What each one changes is listed beside it, and the last column is what that change costs.
| Board | What it changes | 10 disks |
|---|---|---|
| The classic puzzle | Nothing — this is the original | 1,023 2ⁿ − 1, and the count doubles with every disk you add. |
| Random start | Where the board begins | 682 On average two thirds of a full game — and a tidy stack on the wrong tower is as bad as it gets. |
| Four pegs (Reve's puzzle) | An extra tower | 49 Frame–Stewart, proved optimal by Bousch in 2014 after seventy-three years. |
| Cyclic (one direction) | Which moves are legal | 24,959 Grows at (1 + √3)ⁿ, and splits the puzzle into two different problems. |
Read the last column downwards. These are the same ten disks and the same three rules every time, and the shortest possible game runs from 49 moves to 24,959 — a factor of more than 500 — on the strength of one tower and one direction. That is the reason the variants are worth playing rather than reading about: the cost of a rule is not obvious until you are the one paying it.
The boards
The classic puzzle
Three towers, any tower to any tower, one disk at a time.
The puzzle Édouard Lucas sold as a toy in 1883, with a full move timeline, hints and an optimal solver. Start here if you have never played it.
Play it →Random start
The ordinary rules, from a position nobody arranged.
The board is dealt rather than stacked, so the recursion everybody memorises does not apply and you have to find the smaller problem yourself. The solver is still exact, which is what makes this good practice.
Play it →Four pegs (Reve's puzzle)
The ordinary rules on four towers instead of three.
One more tower, and the count stops being exponential in the way everybody expects. Fifteen disks fall from 32,767 moves to 129. The algorithm has a choice to make, which is exactly why it was so hard to prove.
Play it →Cyclic (one direction)
Three towers in a ring; a disk may only move one tower clockwise.
The smallest-looking change on this page and by far the most expensive. Atkinson's 1981 variant, where getting a disk to the far tower means carrying it two thirds of the way round the ring.
Play it →Bicolour
Two disks of every size, in two colours; sort them into two single-colour towers.
Equal sizes may stack, and the two bottom disks have to swap sides. Three sizes take 29 moves — an exact minimum found by searching all 1,728 positions, because no formula is known.
Play it →And one that changes every day
The daily challenge is a random start with one extra property: it is the same random start for everybody, derived from the date rather than from a coin flip. Solve it without the solver and you keep a streak. It is the only board here with a reason to come back tomorrow.
Variants not on this site
Two more turn up regularly in the literature and are worth knowing about even though there is nothing here to play.
The magnetic tower gives each disk a red face and a blue face and forbids landing like on like, so a disk that is flipped by a move can refuse the next one. Five pegs and more generalise Frame–Stewart cleanly and are still only conjectured to be optimal — the 2014 proof covers four pegs and no more.
Tools for the classic puzzle
The solver takes a three-tower position from 3 to 15 disks and returns the shortest solution from it, and the calculator gives the ordinary 2ⁿ − 1 count. Neither knows the variants' rules — each variant's Hint and Auto Solve run its own solver.
Most boards also have a permalink: make a move and press Copy link, and a position can be set as homework, quoted in an answer, or sent to somebody who does not believe you. The daily challenge and the bicolour board are the exceptions.
Questions about Tower of Hanoi variants
What are the variants of the Tower of Hanoi?
The best-known ones change one of three things: how many towers there are, which moves are legal, or where the puzzle starts. Four-peg Hanoi — Reve's puzzle — adds a tower and makes the puzzle dramatically shorter. Cyclic Hanoi arranges the towers in a ring and allows movement in one direction only, which makes it dramatically longer. A random start keeps every rule and simply deals the disks instead of stacking them, and bicolour Hanoi gives every size two disks in two colours to be sorted. Others exist on paper: the magnetic tower where disks have poles, and versions on five or more pegs where the optimal solution is still only conjectured.
Which Tower of Hanoi variant is hardest?
By move count, the cyclic version: 10 disks take 24,959 moves against 1,023 on an ordinary board and 49 on four towers. By difficulty of thought it is the random start, because the method everybody is taught assumes the disks begin in a single stack and there is nothing to recite from a scramble. By difficulty for mathematicians it is four pegs, which took from 1941 to 2014 to be proved.
Do the same rules apply to every variant?
Yes — all three survive. One disk at a time, only the top disk of a tower, and never a larger disk onto a smaller one hold on every board here. What changes is everything around them: how many towers there are on the four-peg board, which way a disk may travel on the cyclic board, where the disks start on the random board, and what counts as finished on the bicolour board.
Is there a Tower of Hanoi with five or more pegs?
Yes, and it is where the mathematics runs out. The Frame–Stewart algorithm generalises to any number of pegs and is believed to be optimal for all of them, but the proof exists only for four. Playing it is also less interesting than it sounds: extra towers past the fourth buy rapidly less, and the board becomes a row of mostly-empty rods.