The diagrams above justify the answers for 2 x 2 x 2, 3 x 3 x 3 and 4 x 4 x 4 cubes.
Check
To check if my formulas were correct, I drew a 5 x 5 x 5 cube and checked if my predictions were correct.
The table proves that the formulas are correct. All my formulae added together should be equal to the total number of small cubes in the large cube which is n3 . Here are the added formulae: n3 = (n – 2)3 + 6 (n – 2)2 + 12 (n – 2) +8
(n - 2)(n - 2)(n - 2) + 6(n - 2)(n - 2) + 12(n - 2) + 8
(n2 - 4n + 4)(n - 2) + 6(n2 - 4n + 4) + 12n - 24 + 8
n3 - 4n2+ 4n - 2n2 + 8n - 8 + 6n2 - 24n + 24 +12n - 24 + 8
n3 + 6n2 - 6n2 + 24n - 24n + 32 - 32
n3
Exceptions
None of the formulae will work for the cube 1 x 1 x 1: This pattern does not work because there is more than one vertex on one cube and therefore there is not going to be 8 cubes with 3 painted sides.
Explaining the Rules
The formula for 0 painted faces is (n – 2)3 . It is n – 2 because the top and bottom ‘lines’ of a cube can’t have a cube that has no faces painted. The answer has to be cubed so that it can be multiplied by the length, height and width.
The formula for 1 painted face is 6(n – 2)2 . It is n – 2 because the top and bottom ‘lines’ of a cube can’t have a cube that has 1 face painted. The answer is squared so that the number of cubes with 1 face painted PER FACE is found. The answer is multiplied by 6 because there are 6 faces in a cube.
The formula for 2 painted faces is 12 (n – 2). The diagram shows us that
it is n – 2 because there are 2 corner cubes per each half of a face.
These 2 cubes cannot have 2 painted faces. The answer to n – 2 has to be
multiplied by 2 to get the corner cubes for the whole face and then multiplied by 6 as there are 6 faces in a cube. 6 x 2 = 12
The formula for 3 painted faces is n = 8 (unless it is a 1 x 1 x 1 cube). Only, a corner cube can have 3 of its faces painted. There are 4 corner cubes in half a cube. So when 4 is multiplied by 2 to get the answer for the number of corner cubes in the whole cube, it is 8. (The corner cubes are shown in white).
It is impossible for any cube to have 4 or 5 painted faces and for any cube bigger than a 1 x 1 x 1, it is impossible to have a cube with 6 painted faces.
Extending the Investigation
I extended the investigation to cuboids. I used measurements 2 x 3 x 4, 2 x 3 x 5 and 3 x 4 x 5.
Exceptions to the rule are cuboids with one or two dimensions of 1.
Check
To check I used a 3 x 4 x 6 cuboid.