# Color the cubes, then assemble them to form a larger cube

Goal: Paint 27 cubes using three colors (for example, red, yellow, and blue), so that you can form a 3x3x3 cube with all surfaces in red (for example), a 3x3x3 cube all in yellow, and a 3x3x3 cube all in blue by rearranging the painted cubes, not repainting them.

• Welcome to PSE! Your question seems unclear to me. Why not just put the cubes into a 3x3x3 cube shape, paint the faces of the larger cube, disassemble, and then paint the rest of the faces whatever colors we want? – Frpzzd Dec 29 '18 at 22:06
• You must be able to assemble the cube in each of the colors. – Daniel Mathias Dec 29 '18 at 22:09
• I ran into the same problem as @Frpzzd, so I tried to edit the question to be a bit more difficult to misunderstand. My sentence structure still seems a bit convoluted, so please feel free to improve it however you see fit. – Bass Dec 30 '18 at 0:22

Paint the small cubes with the colors red, blue, and yellow as follows, so that on each cube, the faces with the same color are all mutually adjacent.
- One cube with three red faces and three blue faces
- One cube with three red faces and three yellow faces
- One cube with three blue faces and three yellow faces
- Three cubes each with three red faces, two blue faces, and one yellow face
- Three cubes each with three red faces, two yellow faces, and one blue face
- Three cubes each with three blue faces, two red faces, and one yellow face
- Three cubes each with three blue faces, two yellow faces, and one red face
- Three cubes each with three yellow faces, two red faces, and one blue face
- Three cubes each with three yellow faces, two blue faces, and one red face
- Six cubes with two faces of each color

Then you have exactly the correct number of corner, edge, face-center, and center pieces for each cube.

• Much better than my answer; well done! – Hugh Dec 29 '18 at 23:12
• @Hugh Thanks! It would be nice to generalize it. The 4x4x4 cube with 3 colors is pretty much trivial, but with 4 colors... hmm... – Frpzzd Dec 29 '18 at 23:22
• This looks very like the expansion of $(RG+GB+BR)^3$ - I haven't figured out quite how yet though! – JonMark Perry Dec 30 '18 at 0:27
• Much the same as my solution, which has six cubes each (3R.2G.1B) (3G.2B.1R) (3B.2R.1G), though I did notice some variation was possible including 4(3R.2G.1B)+2(3R.1G.2B) with similar in 3G and 3B – Daniel Mathias Dec 30 '18 at 3:53
• @Hugh The 4*4*4 with 4 colors is has a similar solution – Daniel Mathias Dec 30 '18 at 3:56

Here is a simple painting procedure that leads to a solution for any size of cube.

1. Start with $$27$$ (or $$64$$, or $$n^3$$) unpainted cubes assembled into a large cube.
2. Paint the outside faces one colour.
3. Rearrange the cubes by removing the bottom layer and placing it on top. >! Similarly take the left-most slice and place it against the right hand side. Finally take the rear slice and place that against the front face. This puts unpainted surfaces on the outside of the cube.
4. Repeat steps 2 and 3 using different colours of paint until all cubes are fully painted.

This method works for any size of cube. Note also that in the finished product, every pair of adjacent cubes has touching faces that share the same colour.

• Beautiful stuff – Jonathan Allan Dec 30 '18 at 19:46

If we use colours R, G and B, then we can write:

$$(RG+GB+BR)^3$$

which expands into

$$R^3G^3+G^3B^3+B^3R^3+3(R^2G^3B+G^2B^3R+B^2R^3G+R^3G^2B+R^2GB^3+RG^3B^2)+6R^2G^2B^2$$ If we let, w.l.o.g., $$R=x, G=B=1$$, then we have: $$(2x+1)^3=8x^3+12x^2+6x+1$$ This describes the number of corner pieces, edge pieces and centre pieces, and the coefficients total $$27$$. To explain a motive, we can see that each colour needs $$54$$ faces, and this fits exactly into the $$27\times6$$ faces we have available. Therefore the non-visible central cube cannot have any of the colours of the visible colour chose. Therefore there must be three of these, and also as we cannot waste space, they must consist of $$2$$ sets of $$3$$ colours. We now need to find six more corners for each colour - these cannot be on the same cube for the same reasons as above, and so we have partially coloured $$3\times6=18$$ more cubes, leaving $$6$$. These six must have $$2$$ of each colour, again for the same reasons. The last pieces then fall into place. Now we can attempt a $$4\times4\times4$$ colouring. The 'characteristic polynomial' we are looking for is: $$8x^3+24x^2+24x+8=(2x+2)^3$$ so we need $$4$$ (symmetric) elements of two each.

I propose:

$$(RB+GB+BY+YR)^3$$

This sounds very similar to...

this puzzle featured in a video by TED-ED. I'll try and make a picture when I get home.