Project Euler Problem 599

The well-known Rubik's Cube puzzle has many fascinating mathematical properties.

Project Euler Problem 599

Solution

Answer: 12395526079546335

Let $G$ be the full group of mechanically reachable transformations of the $2\times2\times2$ cube acting on the $24$ sticker positions.

The key idea is to use Burnside’s Lemma (equivalently, Pólya enumeration):

$$N(n)=\frac1{|G|}\sum_{g\in G} n^{c(g)},$$

where:

  • $n$ is the number of available colours,
  • $c(g)$ is the number of cycles in the permutation induced by $g$ on the $24$ stickers.

For the pocket cube, the action group on stickers has order

$$|G| = 88,179,840.$$

Using the standard six face-turn generators and computing the cycle index polynomial of the action on the 24 stickers, substituting $n=10$ gives the total number of essentially distinct colourings.

A direct computational implementation (e.g. with GAP / Mathematica / permutation-group code) reproduces the check value

$$N(2)=183,$$

matching the example in the problem statement.

Evaluating the cycle index at $n=10$ yields:

$$N(10)=12395526079546335.$$

Answer: 12395526079546335