# Does a Fixed Sequence of Moves Solve Any Rubik's Cube Configuration When Repeated Enough Times?

Question: Can a fixed sequence of moves restore any Rubik's Cube configuration to its solved state when repeated enough times?

I’m wondering if it's possible to use a fixed sequence of moves (a "set of actions") to always return a Rubik's Cube to its solved state, no matter the starting position, by repeating this sequence multiple times. Here’s what I mean by a "set of actions":

A set of actions is a specific, unchanging sequence of moves. The rules are:

• The sequence must be followed exactly as given, without any changes.
• You can repeat the sequence as many times as needed.
• You cannot add, remove, or change moves in the sequence during its application.
• You must complete the entire sequence before starting over.

For instance, a method that requires varying numbers of moves wouldn’t count because it doesn’t follow a fixed, repeatable sequence.

The question is whether such a sequence exists that, when applied repeatedly, will always solve the cube, regardless of the initial configuration. The sequence doesn’t have to be the shortest or most efficient solution, just a reliable way to restore the solved state.

Does such a fixed sequence exist?

• Are you asking whether the Rubik's cube group is cyclic? Commented Jul 23 at 5:25
• @Gribouillis: I don't think this is quite equivalent, because I don't think the action of the Rubik's cube group on the set of states of the Rubik's cube is free? Commented Jul 23 at 5:30
• @QiaochuYuan You are correct. It is not exactly the same thing. Besides, if the group was cyclic, it would be abelian, which is obviously false. Commented Jul 23 at 5:52
• @QiaochuYuan I'm not sure if I get what you're trying to drive at -- I thought the Rubik's cube group was essentially defined as the quotient of the free group on six generators such that the action on the set of Rubik's cube states would be a free action (with the "solved" state being a distinguished base element, so it's not even just a torsor, it has a canonical isomorphism to the free action)? Commented Jul 23 at 16:33
• @Daniel: that seems like a strange definition; the natural definition would just be the subgroup of the permutation group generated by the six generators, or equivalently the quotient such that the action is faithful. I don't know either way whether the action is free (I googled around a bit and nobody seems to either confirm or deny this) but in any case I took an approach that doesn't depend on the answer. Commented Jul 23 at 16:41

No. According to Wikipedia it's known that the largest order of an element of the Rubik's cube group is $$1260$$; what this means is that any fixed sequence of moves must start repeating states after at most $$1260$$ iterations, so it's not possible for any fixed sequence of moves to reach more than $$1260$$ states from a given state, and the Rubik's cube has many more than $$1260$$ possible states.

(I'm assuming intermediate states reached before the sequence of moves is finished don't count, because if they did, you could just perform, once, an extremely long sequence of moves that is guaranteed to hit every state, but I assume that isn't what you intended.)

Edit: The reason I went to all this trouble is that I didn't understand whether the Rubik's cube group acted freely on the set of reachable states, but it does; given that, the question is equivalent to asking whether the Rubik's cube group is cyclic, and then other easier arguments are available, e.g. one can show that it's nonabelian.

The discussion in the linked question also gives us a self-contained way to bound the order of an element of the Rubik's cube group $$G$$, which is no longer necessary here but is interesting. Namely, we can embed $$G$$ into the "illegal Rubik's cube group" where we allow ourselves to freely disassemble and reassemble the cube; this group is

$$G_I \cong (C_3 \wr S_8) \times (C_2 \wr S_{12})$$

where the first factor corresponds to permuting and reorienting the corner cubies and the second factor corresponds to permuting and reorienting the edge cubies. Write $$e(G)$$ for the exponent of a group (the smallest $$n$$ such that $$g^n = e$$ for all $$g \in G$$). Then

• $$e(G \times H) = \text{lcm}(e(G), e(H))$$,
• $$e(C_k \wr S_n) = k \, e(S_n)$$, and
• $$e(S_n) = \text{lcm}(1, 2, \dots n)$$, which is A003418 on the OEIS. We have $$e(S_8) = 840, e(S_{12}) = 27720$$.

Putting this all together gives

$$e(G_I) = \text{lcm}(3 \times 840, 2 \times 27720) = 55440$$

so the order of an element of $$G$$ divides this. Then we can prove in various ways that the Rubik's cube has many more states than this. A more careful version of this argument could find the largest order of an element of $$G_I$$; I think it's $$2520$$, which is twice the above.

• The long sequence in your second paragraph is called devil's algorithm. Commented Jul 23 at 21:50
• Funny stuff: anttila.ca/michael/devilsalgorithm Commented Jul 23 at 22:21

You are asking whether the group of all operations that can be performed on the Rubik's cube is cyclic (i.e., there exists a particular operation such that all operations are (integer) powers of it)*. The other answer indicates that the known longest order (number of iterations necessary to come back to the point of departure) of any fixed operation is much too small to obtain all configurations in the process of iterating it. However even without knowing much about the Rubik's cube group at all, it is easy to see that the group is not cyclic. Here are two easy arguments, each of which shows this.

(1) Any cyclic group is commutative (since the composition of two powers of a same operation is the power with the sum of their exponents, which does not depend on the order of composition). But clearly this is not true for the Rubik's cube group; indeed just taking any pair of basic moves (turn one face a quarter turn) not involving the same or opposite faces, one sees that they do not commute.

(2) The Rubik's cube group has at least 12 elements of order$$~4$$ (since all basic moves have order$$~4$$). But a cyclic group can have at most 2 elements of order$$~4$$: if the generator $$g$$ of the group has order $$4m$$ then $$g^m$$ and $$g^{3m}$$ are the only elements of order$$~4$$, and if the order of the generator is not divisible by$$~4$$, then there are no elements of order$$~4$$ at all (by Lagrange's theorem).

*As was remarked in the comments, this supposes that fact that each reachable configuration can be obtained from the initial configuration by a unique group element, so that the set of reachable configurations is in bijection with the group. Mathematically this can be stated as the fact that the action of the group on the set of reachable configurations is free (and therefore simply transitive): any sequence of moves that transforms just one reachable configuration into itself will do the same to any configuration, and therefore represent the identity group element. I've separated out the proof of why this is so to a separate question.

• Sorry, I am still not convinced the question is equivalent to the Rubik's cube group being cyclic. The question is equivalent to whether a cyclic subgroup of the Rubik's cube group can act transitively on the set of reachable states. The equivalence would follow if we knew that the action of the Rubik's cube group on the set of reachable states is free; do we know this? I can't find anyone claiming this from googling quickly. Commented Jul 25 at 19:59
• @QiaochuYuan: This seems pretty obvious to me. A state is determined by the assignment of colours to each of the $6\times9$ small squares, but this also determines the position of all $26$ physical moving parts (since each has a different colour scheme). By definition an operation $g$ is the neutral element if $g\cdot x=x$ for all reachable configurations $x$. I claim it is sufficient that this is true for some $x$, which then shows the action is free. Any other state $y$ can be obtained (cheatingly) from $x$ by repainting squares. Applying $g$ trivially moves all parts, so it fixes $y$. Commented Jul 25 at 20:30
• I'm afraid I don't follow this argument. Color assignments don't determine the position of the centers, which a priori can rotate; IIRC it is possible on a decorated Rubik's cube (I used to have one of these) to return to the solved state except that some of the centers are rotated, which would in fact show that the action is not free, yes? Admittedly the point stabilizer seems very small but I still think one needs a tiny extra argument to conclude from here. Commented Jul 25 at 21:12