Determine the highest order of an element of a Rubik's Cube group
The maximum orders for a $n\times n\times n$ Rubik's cube group: \begin{align*}n=2: &\quad 3^2\cdot 5 = 45\\ n=3: &\quad 2^2\cdot 3^2\cdot 5\cdot 7 = 1260\\ n=4: &\quad 3^2\cdot 5\cdot 7\cdot 11\cdot 13\cdot 17 = 765765\\ n=5: &\quad 2^4\cdot 3^2\cdot 5\cdot 7\cdot 11\cdot 13\cdot 17\cdot 23 = 281801520\\ n\ge 6: &\quad 2^4\cdot 3^2\cdot 5\cdot 7\cdot 11\cdot 13\cdot 17\cdot 19\cdot 23 = 5354228880\end{align*}
In general, there are five types of piece to consider:
- For odd $n$, each face has a center. By convention, we treat these as fixed. If we don't, they can be rotated like a solid cube, for a copy of $S_4$. Highest order $4$, least common multiple $2^2\cdot 3=12$. As the largest possible order is divisible by $12$ for all odd $n\ge 3$, whether we include these doesn't affect the answer.
- For any $n\ge 2$, there are $8$ corner pieces which can be permuted and rotated, a semidirect product of $S_8$ and $(\mathbb{Z}/3)^8$ - except that that the "sum" of those rotations is zero, dropping one factor of $3$ from the latter part. The order of an element is at worst $3$ times the order of an element of $S_8$. Highest possible order $15\cdot 3=45$, least common multiple $2^3\cdot 3^2\cdot 5\cdot 7$.
- For any odd $n\ge 3$, there are $12$ centers of edges, which can be permuted and reflected. The number of reflections must also be even, for a semidirect product of $S_{12}$ and $(\mathbb{Z}/2)^{11}$. Highest possible order $60\cdot 2=120$, least common multiple $2^4\cdot 3^2\cdot 5\cdot 7\cdot 11$.
- For any $n\ge 4$, there are $\left\lfloor\frac{n}{2}\right\rfloor-1$ orbits of 24 off-center edges, which can't change how far from the center of their edge they are. The pair of edges on each side are distinguishable due to being reflections of each other, and the group for each set of these pieces is a copy of $S_{24}$. Highest possible order $8\cdot 7\cdot 5\cdot 3 = 840$, least common multiple $2^4\cdot 3^2\cdot 5\cdot 7\cdot 11\cdot 13\cdot 17\cdot 19\cdot 23$.
- For any $n\ge 4$, there are $\left\lfloor\frac{(n-2)^2}{4}\right\rfloor$ orbits of 24 off-center face pieces each. These can be rotated in their face, but not reflected; mirror images across a symmetry line within a face (in size $\ge 6$) are separate orbits. Each piece of the same color in one of these sets is indistinguishable, so that gets us an action of $S_{24}$, with $\frac{24!}{24^6}$ possible states. The possible orders are the same as in the previous case. In terms of what we need to solve the cube, there are three variants based on whether they lie on a symmetry line of a face - but they're all the same for the count we care about here.
So then, the highest possible order in any Rubik group is the least common multiple of all of these, namely $2^4\cdot 3^2\cdot 5\cdot 7\cdot 11\cdot 13\cdot 17\cdot 19\cdot 23$. This is achieved for all $n\ge 6$; we have at least six of the size-24 orbits, which we can use to produce orders of $16\cdot 5$, $9\cdot 11$, $7\cdot 13$, $17$, $19$, and $23$.
Now, all of this assumes that we can modify the pieces in each orbit independently. That isn't quite true - several combinations must be even permutations. First, for odd $n$, the combined permutation of corners and edge centers is even; they're modified by face rotations, each of which is a 4-cycle of edges and a 4-cycle of corners. Second, for $n\ge 4$, the combined permutation of the corners and an orbit of pieces on face diagonals is even. Next, for $n\ge 6$, each mirrored pair of orbits of off-center face pieces must have a combined even permutation; each face rotation and each relevant slice rotation is a 4-cycle in each of the orbits. Finally, for odd $n\ge 5$, the combined permutation of off-center edge pieces, pieces on face diagonals, and pieces on face midlines at a fixed distance from the center is even. These parity restrictions are the only additional restriction; other than that, the orbits can be manipulated independently.
How does this change things? For the $n\ge 6$ case, all we have to do is implement the order $16\cdot 5$ piece as the product of a $16$-cycle, a $2$-cycle, and a $5$-cycle. Then all of the permutations we're working with are even, so there aren't any problems. In the smaller cases, we'll have to check.
For $n=2$, only the corners matter, and the highest order is $45$.
For $n=3$, we have corners and edge centers. With $17$ possible orders for the first and $31$ for the second, we can just scan all of the possible combinations. The highest LCM is $2520$, from order $45$ (3-cycle, 5-cycle, rotations in the 3-cycle don't add to zero) in the corners and order $56$ (4-cycle, 7-cycle, reflections in the 4-cycle don't add to zero) in the edges. This, however, doesn't pass the parity check; the combined permutation is odd, and there's no wiggle room to change that. That leaves us dropping down to the second-highest possibility of $1260$, possible in several ways ($45$ and $28$, $45$ and $84$, $35$ and $36$, $70$ and $36$). Three of those fail the parity check, leaving only the pair of order $45$ in the corners and order $28$ (Two 2-cycles, a 7-cycle, reflections in at least one 2-cycle don't add to zero) in the edges. Highest order $1260$, as previously noted.
For $n=4$, we have the corners, one orbit of off-center edges, and one orbit of off-center face pieces. With over a hundred possible orders in $S_{24}$, finding the least common multiple isn't the easiest search. Pruning everything with an order that divides another gets that down to a manageable total of $27$, and $5$ for the corners. Running it in the spreadsheet I've been using, the LCM is $765765=3^2\cdot 5\cdot 7\cdot 11\cdot 13\cdot 17$; $45$ in the corners, $11\cdot 13$ in the edges, and $7\cdot 17$ in the faces. Checking parity... all the pieces are odd permutations, so we'll actually have something of that order.
For $n=5$, we have corners, edge centers, three size-24 orbits, and two parity restrictions that cross orbits. The best I've got here is $2^4\cdot 3^2\cdot 5\cdot 7\cdot 11\cdot 13\cdot 17\cdot 23 = 281801520$; it could use an independent check, but I'm pretty sure it's right. The three size-24 orbits get us orders of $23$, $7\cdot 17$, and $11\cdot 13$ while the corners give us order $45$ and the edges give order $16$ (an 8-cycle and a 2-cycle, with an odd number of reflections in the 8-cycle). They're all odd permutations, so the parity checks pass.
For $n\ge 6$, as previously noted, we reach the maximum possible order $2^4\cdot 3^2\cdot 5\cdot 7\cdot 11\cdot 13\cdot 17\cdot 19\cdot 23 = 5354228880$.