# Number of unique permutations of a 3x3x3 cube, including transforms

I asked the question Number of unique permutations of a 3x3x3 cube but now I want to know a similar but related question.

If I have the numbers 1-27 and I assign each small-cube in a 3x3x3 matrix one number, how many permutations are there including rotations like how a Rubik's cube can do.

I think this questions is basically this.

If have 4 buckets (corner, edge, face, middle) and each one can hold a certain number of cubes (corner=>8, edge=>12, face=>6, middle=>1), how many different combinations of the 27 small-cubes can I put into the 4 buckets.

$$\frac{27!}{8!12!6!1!} = 783{,}055{,}973{,}700$$
In the first bucket of 8, you can choose, $27*26*25*24*23*22*21*20$, but then order doesn't matter so divide by $8!$. Then the calculation for the bucket of 12 is similar: $19*18*\cdots*8$. But again order doesn't matter so divide by $12!$. And when you do the same for the last two buckets you arrive at the answer.