Burnside's lemma

The number of rotationally distinct colourings of the faces of a cube using three colours can be determined from this formula as follows.

Hence there are 57 rotationally distinct colourings of the faces of a cube in three colours. In general, the number of rotationally distinct colorings of the faces of a cube in n colors is given by