Well done to Rajeev from Fair Field Junior School who sent us this solution:

Jo noticed that when she painted some of the faces of her cube then $45$ faces had no paint on them. Her cube was $5 \times 5 \times 5$, and $4$ faces were painted, so $80$ cubes had paint on them and $45$ cubes were unpainted.

Here is a table showing the number of painted cubes for different sizes of cube and numbers of faces painted:

 Dimensions of Cube Number of Cubes 1 face painted 2 opposite faces painted 3 faces painted 4 faces painted 5 faces painted 6 faces painted $2\times2\times2$ $8$ $4$ $8$ $8$ $8$ $8$ $8$ $3\times3\times3$ $27$ $9$ $18$ $21$ $24$ $25$ $26$ $4\times4\times4$ $64$ $16$ $32$ $40$ $48$ $52$ $56$ $5\times5\times5$ $125$ $25$ $50$ $65$ $80$ $89$ $98$ $6\times6\times6$ $216$ $36$ $72$ $96$ $120$ $136$ $152$ $17\times17\times17$ $4913$ $289$ $578$ $833$ $1088$ $1313$ $1538$ $n \times n \times n$ $n^3$ $n^2$ $2n^2$ $3n^2-2n$ $4n^2-4n$ $5n^2-8n+4$ $6n^2-12n+8$

When Jo had to paint the 2nd face she painted the opposite face. I noticed that it does make a difference in what pattern the faces are painted. The above table applies when painting the second face the one opposite the painted face is painted and after that then you can paint the other faces in any order. Another way to do it is to paint the adjacent face- so after painting the 1st face(say right side) you paint the 2nd face adjacent to it and the 3rd face (say top face)painted must be touching the two painted faces and the 4th face (say bottom face) and the 5th face any remaining side.

Rajeev highlights the idea that painting faces in a different arrangment affects the number of painted cubes. Here is a table with all possible arrangements.

When faces of a larger cube are painted then the number of unpainted cubes depends upon whether the opposite or the adjacent face was painted when painting the second face. Jo's 2nd face was the opposite face so when she painted the 4th face she had $45$ unpainted cubes. If Jo had started painting the adjacent face then she would have been left with $48$ cubes in a $5\times5\times5$ cube.

There is more than one way to end up with any number of cubes - you can end up with $27$ unpainted faces when you paint three adjacent faces in a $4\times4\times4$ cube and also in a $5\times5\times5$ cube when you paint all $6$ faces.

Another way to think about this problem is to imagine removing all the painted cubes and leaving behind a cuboid each time. What can you say about the difference between the largest and smallest dimension of such a cuboid?