You may also like

Three Cubes

Can you work out the dimensions of the three cubes?

Nine Colours

Can you use small coloured cubes to make a 3 by 3 by 3 cube so that each face of the bigger cube contains one of each colour?

Marbles in a Box

How many winning lines can you make in a three-dimensional version of noughts and crosses?

Painted Cube

Age 14 to 16
Challenge Level

We received many correct solutions to this problem - from Adam from Knoxdale P. S., Ramsudheer from Smith Elementary School, Ojaswi, Bill from King's St. Alban's, Chantell, Billy, Connor and Chanel from Arunside, Rajeev from Fair Field Junior School, Jessica from Beeston Rylands Junior School, Finlay from Gledhow Primary School, Olivia and Martha from St.Johns C.E. Primary School, Yuki from King's School Ely, Belky, Mark from Gledhow Primary School, James and Arjun from Wilson's, William from Barnton Community Primary School Alice, Joanna from Woodmill High School, Derek, Robert from Ardingly College Junior School, Joe from Lady Manners School in Bakewell and students from Rawdon Littlemoor Primary School. Well done to you all.

Alan wrote:

There is only one small cube that will not have any yellow paint on it. That cube is in the centre of the combined cubes. I figured it out by visualizing having the faces of the large cube with paint cut off until only the small centre cube remained.

The small cubes with paint will not all look the same because the ones that are not on an edge or vertices will have 1 face covered while the ones on the vertices will have three faces covered with paint.

If you do it with a 4 by 4 by 4 cube, you will end up with a 2 by 2 by 2 cube left without paint and if you do it with a 5 by 5 by 5 cube you will end up with a 3 by 3 by 3 cube without paint.

Chantell, Billy, Connor and Chanel sent us this clear table summarising their findings. Rajeev sent us a very similar table of results.


Yuki noticed that:

The number of painted cubes is: n$^3$ - (n-2)$ ^3$

Students from Crestwood College also mentioned this.

Arjun also worked on this:

For 1 by 1 by 1 cube there is 1 cube painted.
For 2 by 2 by 2 cube, all 8 are painted.
For 3 by 3 by 3, there are 26 painted.
For 4 by 4 by 4, there are 56 painted.

Mark from Gledhow Primary School produced this spreadsheet.

Robert summarised his findings as follows:

"Let n= number to be cubed

No. of small cubes with 6 red faces = (n-2)$^3$

This is because the cubes in the centre remain clean, so you must take one off either edge and then cube it.

No. of small cubes with 5 red faces = 6(n-2)$^2$

This is because there are 6 faces to the cube, and only the ones not on the edge remain clean on 5 sides. So you must take one off either edge, then square it, then multiply it by the 6 faces.

No. of small cubes with 4 red faces = 12(n-2)

This is because there are 12 non-corner edges which is multiplied by n (which = 1 whole edge) -2 for the 2 corners.

No. of small cubes with 3 red faces = 8

This is because there are always 8 corners

The total No. of small cubes is always n cubed"

Alice described her findings in a similar way:

"First of all I imagined a 3x3x3 cube being dipped in paint - that's how I worked the first one out then we worked out that

1) the number of cubes with 6 red faces equalled (n-2)$^3$, like when you take the skin off a square orange, taking a layer off each side

2) 5 red faces 6(n-2)$^2$, which is like the above but for the faces instead of the middle (it's squared not cubed ) and you have to multiply it by 6 because there are 6 faces

3) 4 red faces 12(n-2) this is the edges, take 2 for the corners and multiply it by 12 because that's how many edges there are

4) 3 red faces always got to be eight because these are corners (unless your cube is 1x1x1)

5) total number of small cubes is n$^3$

Joe, Derek and Alice completed the table of results:

Size of large cube

No. of small cubes with 6 red faces

No. of small cubes with 5 red faces

No. of small cubes with 4 red faces

No. of small cubes with 3 red faces

Total No. of small cubes

3 x 3 x 3






4 x 4 x 4






5 x 5 x 5






6 x 6 x 6


















10 x 10 x 10






23 x 23 x 23






n by n by n






NB. The values for n are correct unless n = 1.
When n = 1 the single cube will have no red faces.


In her conclusion Alice added that in the second column the numbers were all cubic numbers, in the third column square numbers times 6 and in the fourth column multiples of 12.

Belky explained how she reached her results. This is how she arrived at a formula for the number of cubes with two faces painted :

From my results, I tried to find patterns, which would enable me to find a formula. I looked closely for patterns throughout the numbers.

I looked for a pattern in my results to find how many cubes had two faces painted. I wrote the numbers down, to see if they had a pattern between them:
0, 12, 24, 36, 48...
I found the numbers increased by 12. I assumed the formula was '12n'.
I tried out the formula by using 'n = 2' and multiplied it by 12, totalling up to 24. This was incorrect as I needed the answer to be 0.
This made me realise I would have to minus a number in order to get my formula right.
I tried subtracting 2 from 'n' to find it was the correct method.
I tested it on 2 x 2 x 2:
12(n - 2) when n = 2
2 - 2 = 0
12 x 0 = 0
This was correct.

Both William and Derek showed that:

We can verify that all cubes have been accounted as:$$(n-2)^3 + 6(n-2)^2 + 12(n-2) + 8 $$ $$= (n-2) (n^2 - 4n + 4) + 6 (n^2 - 4n + 4) + 12n - 24 + 8 $$ $$ = n^3 - 4n^2 + 4n - 2n^2 + 8n -8 + 6n^2 - 24n + 24 + 12n - 24 + 8 $$ $$ = n^3 $$

Derek added this diagram to support his conclusions:

Image of painted cube


Mollie and Hannah from Comberton Village College also sent in some excellent solutions; follow the links below to see their work:

Mollie's solution
Hannah's solution