Variant
Cyclic Tower of Hanoi
Disks move one tower clockwise only: A → B → C → A. Five disks take 163 moves instead of 31.
Move History & Timeline
0 / 0 moves
—No moves yet. Make your first move!
The original, in a row
The puzzle this one is a variant of — same towers, same disks, and any disk free to go to any tower it fits on.
Play Tower of Hanoi →The variant that goes the other way
A fourth tower instead of a lost direction — the same puzzle made dramatically shorter rather than dramatically longer.
Four-peg Tower of Hanoi →On this page
Play cyclic Hanoi
The board above is the ordinary puzzle with one rule added: a disk may only move to the tower one step clockwise of the one it is on. From A it can only go to B; from B only to C; and from C it wraps round to A. Everything else is the same. Drag a disk, or click a tower to lift its top disk and click another to drop it; keys 1 to 3 reach the towers, and Undo, the timeline, hints and Auto Solve all behave exactly as they do on the main board.
Play three disks here and then three disks on the ordinary board. The ordinary game is seven moves and takes under a minute; this one is 21, and the reason is the whole of this page.
The one rule that changes
Stop thinking of the three towers as a row and start thinking of them as a triangle. In the ordinary puzzle every tower is one move from every other, so the layout is decoration — you could shuffle the towers on the table and nothing about the game would change.
The cyclic version takes that away. The towers sit in a ring and traffic runs one way round it, like a roundabout. A disk that needs to get from A to C cannot simply go: it has to stop at B on the way, and it can only stop there if B will hold it.
That is the entire difference, and it is worth noticing how small it looks written down. The rules a player has to remember have gone from three to four. The shortest solution has gone from 1,023 moves to 24,959 at ten disks — twenty-four times the work.
Two problems, not one
Here is the first thing the ring breaks. On an ordinary board, "move the stack to that tower" is one question with one answer, and it is 2n − 1 whichever tower you point at. In a ring the two neighbours are not interchangeable: one is a single step with the traffic, and the other is two.
So there are two puzzles, and Atkinson named them. The short problem is carrying the stack one step with the direction. The long problem is carrying it two steps — which is the game this board plays, because the goal is the right-hand tower.
The short problemA → B · 119 moves
Tower B is one step with the direction, so the largest disk gets there in a single move — exactly as it would on an ordinary board. Everything above it still has to be swept out of the way the long way round, which is why 5 disks cost 119 moves rather than 31.
The long problemA → B → C · 163 moves
Tower C is two steps away, and there is no shortcut — so every disk makes the journey twice, and the whole stack above it has to be cleared twice over. This is the game the board plays, and it costs 163 moves for 5 disks.
Neither is the ordinary puzzle. Even the short problem — where the largest disk makes exactly one move, just as it would on a normal board — costs 119 moves at five disks rather than 31, because everything above that disk still has to travel the long way round to get out of its way and the long way back to get on top of it again.
How many moves it takes
Read the last two columns against the second. The ordinary puzzle doubles with every disk; both cyclic columns nearly triple.
| Disks | Ordinary board | Short problem (A → B) | Long problem (A → C) |
|---|---|---|---|
| 3 | 7 | 15 | 21 |
| 4 | 15 | 43 | 59 |
| 5 | 31 | 119 | 163 |
| 6 | 63 | 327 | 447 |
| 7 | 127 | 895 | 1,223 |
| 8 | 255 | 2,447 | 3,343 |
| 9 | 511 | 6,687 | 9,135 |
| 10 | 1,023 | 18,271 | 24,959 |
The two cyclic columns are OEIS A005665 and A005666, and they are produced by each other:
short(n) = 2 · long(n − 1) + 1
long(n) = 2 · long(n − 1) + short(n − 1) + 2
Read the first one. To carry n disks one step clockwise, the largest has to make the single move A → B. For that, B has to be empty, so every smaller disk must be on C — which is two steps away, a long problem. And once the big disk has moved, those same disks have to come from C to B, which is two steps as well. Two long problems and one move.
Solving it from anywhere
The second recurrence is the game on this page, and it is worth seeing as five stages rather than as algebra. Take 5 disks on A, heading for C:
| Step | What moves | Why it has to | Moves |
|---|---|---|---|
| 1 | Carry disks 1–4 from A all the way round to C | Disk 5 can only leave A for B, so B must be empty — which leaves exactly one place for everything above it. | 59 the long problem, one size down |
| 2 | Move disk 5 from A to B | The only move it has. | 1 one move |
| 3 | Carry disks 1–4 from C to A | Disk 5 now has to reach C, so C must be cleared — and A is one step with the direction. | 43 the short problem, one size down |
| 4 | Move disk 5 from B to C | Its second and last move. It is home. | 1 one move |
| 5 | Carry disks 1–4 from A to C | Two steps again, on top of the disk that is already there. | 59 the long problem, one size down |
| — | A perfect game of 5 disks, A to C | 163 | |
Now look at the middle column, because it is doing something the four-peg algorithm cannot. Every line of it says has to. There is no choice about where the small disks go, because there is only one tower they can be on when the big disk moves. There is no choice about the big disk's route, because a third step round the ring would only bring it back where it started. Nothing in the plan is a decision, so there is nothing for a cleverer plan to decide differently.
That is why the solver on this board is stronger than the one on the four-peg board. There, no fast method is known for the shortest route between two arbitrary positions, so the board can only tell you how many moves its own solver would take. Here the same forced argument applies from wherever the board happens to be — pick up the argument at the largest disk that is not yet home — so Auto Solve plays a proven optimum from any position you can scramble it into, and the readout under the board tells you how many moves you are behind rather than guessing.
Why it grows at (1 + √3)n
Substitute the first recurrence into the second and the short problem disappears:
long(n) = 2 · long(n − 1) + 2 · long(n − 2) + 3
Each term is built from the two before it, and the rate a relation like that grows at is the positive root of its characteristic equation, r² − 2r − 2 = 0 — which is r = 1 + √3 ≈ 2.732.
You can see it in the table without doing any of that. Divide any long-problem row by the one above it — 24,959 ÷ 9,135 — and the answer closes in on 2.73: 2.81 at four disks, and 2.73 to two places from eight disks on.
The gap against the ordinary puzzle therefore widens without limit, at a rate of about 1.37 per disk. Three disks cost three times as much; five cost five times; ten cost twenty-four times. It is the clearest demonstration on this site that the base of an exponential is what matters and the constant in front of it is not — the same point sixty-four disks make with 2ⁿ, made twice as loudly with a slightly larger number.
The puzzle is Atkinson's, from The Cyclic Towers of Hanoi (Information Processing Letters, 1981) — a two-page paper that poses both problems, gives the recurrences and proves them optimal in the same breath. The four-peg puzzle took seventy-three years to reach the same certainty. Forced moves are worth a great deal to a mathematician and nothing at all to a player.
Questions about cyclic Hanoi
What is the cyclic Tower of Hanoi?
It is the ordinary Tower of Hanoi with the three towers arranged in a ring instead of a row, and one extra rule: a disk may only ever move one tower clockwise — A to B, B to C, or C back round to A. Everything else is unchanged. One disk at a time, only the top disk of a tower, never a larger disk onto a smaller one, and the goal is still the whole stack on the far tower. It was analysed by M. D. Atkinson in 1981, and it is a genuinely harder puzzle rather than a cosmetic variation.
How many moves does cyclic Tower of Hanoi take?
Far more than the ordinary puzzle, and the gap widens with every disk. Moving the stack to the far tower — the game played on this page — takes 21 moves for three disks against 7, 163 against 31 for five, and 24,959 against 1,023 for ten. There is no closed formula like 2ⁿ − 1; the counts come from a pair of recurrences and are OEIS A005665 and A005666.
Why does the cyclic version have two different answers?
Because in a ring the two neighbours of a tower are not the same distance away. Moving the stack one step with the direction — A to B — is called the short problem, and moving it two steps to A's other neighbour is the long problem. On an ordinary board both are the same job and both cost 2ⁿ − 1. Here the long problem costs over a third more than the short one at every size — forty per cent at three disks, settling to about thirty-seven — because the largest disk has to make the trip twice and everything above it has to be cleared out of the way twice.
Is the cyclic solution proven to be the shortest?
Yes, and unlike the four-peg puzzle it was proven straight away. Every move is forced: to move the largest disk at all, every smaller disk must be on the one tower it is not going to, and there is no choice about which tower that is or about the route the large disk takes. That leaves nothing for a cleverer solution to be cleverer about, so the recursive plan is the only plan — which is also why this board can tell you how many moves you are off optimal, and the four-peg board cannot.
How fast do cyclic Tower of Hanoi move counts grow?
They roughly multiply by 1 + √3 ≈ 2.732 with each extra disk, where the ordinary puzzle multiplies by 2. That constant comes straight out of the recurrence: the number of moves satisfies a relation whose characteristic equation is r² − 2r − 2 = 0, and 1 + √3 is its positive root. The practical effect is that ten cyclic disks cost more moves than fourteen ordinary ones.
Can the solver finish a cyclic board I have scrambled myself?
Yes, and it finishes it in the fewest moves that exist. Auto Solve, Hint and Step all run the same forced plan, which works from any legal position rather than only from a full stack — so the moves-off-optimal readout under the board is a fact, not an estimate, and the gap it shows genuinely cannot shrink.