Problem: Given a 2 x 2 x 2 cube made of 8 1 x 1 x 1 blocks. If the cube is painted, then each of the blocks has 3 of its faces painted.
If a 3 x 3 x 3 cube is painted, a given block may have 0, 1, 2 , or 3 of its faces painted.
Count how many of each.
Do the same for a 4 x 4 x 4 cube, a 5 x 5 x 5 cube, and a n x n x n cube.
Now, let us see an example of a 4 x 4 x 4 cube, then below is three 4 x 4 x 4 cubes with the cubes that will be painted 1, 2, and 3 sides.
We attempted to look for a pattern after constructing the first few cubes and looking at the trends in sides painted for each cube.
For 0 sides painted, we found that if n = (the number blocks on one row or column of the cube), then (n-2)^3 is the number of cubes with 0 sides painted.
For 1 side painted, we found that the pattern was 6(n - 2)^2 = the number of cubes with 1 side painted.
For a cube with 2 sides painted, we found that the pattern was 12(n - 2) = the number of cubes with 2 sides painted.
For the cubes with 3 sides painted, it will always be 8. The eight painted cubes are the 8 corners of any and all cubes.
The spreadsheet below takes you through the first nine cunes with n x n x n sides.
Now, we have found these four values for our cubes with n sides:
looking at the four values, one notices that the values are the products of a binomial expansion.
the expansion of the binomial looks as such
Brian Seitz's homepage