
Ryan K. answered 05/14/20
Master's Degree in Mathematics
Are you familiar with Burnside's lemma? https://en.wikipedia.org/wiki/Burnside%27s_lemma
I suppose it may be possible to do this without it, but it would be painful. Given that the number of possible ways to color the cube three colors is 38, or 6561, it would not be too awful to program a solution.
Anyways, the idea of Burnside's lemma is that, given some coloring, we want to see what other colorings we get by rotated and flipping the cube (this is the "orbit" of the coloring), and count that altogether as one coloring.
I highly recommend looking at the above Wikipedia link. It lays out the process for just the rotations of the cube, and counting the number of colorings on the faces. However, I would like to add some detail, since I think it's not entirely clear (but if you understand it, feel free to skip ahead a bit). First of all, if you're uncertain as to how there are 24 rotations, I recommend reading this: http://www.markronan.com/mathematics/symmetry-corner/the-rotations-of-a-cube/
Now, assuming you understand that there are six 90 degree face rotations, you might be wondering where they get 33 from. The base 3 is the number of colors allowed (so n = 3 for us as well), and the exponent comes from how many faces we can color to uniquely determine a coloring fixed by the rotation. In other words, if you have a cube in front of you, and you spin it 90 degrees on your desk, you can color the top face, the bottom face, and one of the middle faces; all the other middle faces are determined by the color of one if we want the coloring to be fixed by the rotation.
Let's take a look at your problem. From the sounds of it, you need to also care about mirror symmetries (as in swapping the left and right faces without also swapping the front and back faces, as in a 180 degree face rotation). Since any mirror symmetry, combined with all of the rotations, gives every mirror symmetry, we see that we have 24*2 = 48 symmetries. But first, we will do the rotations, and then the symmetries. Let's take a look at the terms we get (this works in essentially the same way as the Wikipedia example, but we are looking at the orbits of corners):
Identity rotation: there is one such rotation, we get 38.
90 degree face rotations: there are six, we get 6*32.
180 degree face rotations: there are three, we get 3*34.
120 degree corner rotations: there are eight, we get 8*34.
180 degree edge rotations: there are six, we get 6*34.
Now the reflections:
No rotation, just reflection: There is one such move, we get 34.
90 degree face rotation and then reflect: there are six, we get 6*36.
180 degree face rotation and then reflect: there are three, we get 3*34.
120 degree corner rotation and then reflect: there are eight, we get 8*32.
180 degree edge rotation and then reflect: there are six, we get 6*32.
I think I got those all right, but you might want to check with a cube of your own.
Now we sum and divide by 48 (the number of symmetries). WolframAlpha tells me this is 267. That should be your answer!