Aline received as a gift a cube composed of $4 \times 4 \times 4$ small white cubes, as shown in the following figure.

![](https://cdn.mathpix.com/cropped/2024_05_01_d18780f0fd52e0502cf8g-14.jpg?height=356&width=368&top_left_y=1284&top_left_x=750)

Without separating the small cubes, Aline decided to paint all the faces of her cube red.

a) How many small cubes ended up with exactly one of their faces painted red?

b) How many small cubes ended up with exactly two of their faces painted red?

Some time later, Aline asked her father for an even larger cube to paint in the same way she had done with the previous cube.

c) After painting, Aline separated the small cubes. She noticed that the number of small cubes that remained with no faces painted red was equal to three times the number of small cubes that had two faces painted red. Determine the size of the new cube Aline received.
Solution

a) On each face of the cube, the small cubes that end up with one face painted red are the four that are in the center, that is, those that do not have any edge contained in an edge of the large cube. The figure below illustrates which these cubes are.

![](https://cdn.mathpix.com/cropped/2024_05_01_d18780f0fd52e0502cf8g-40.jpg?height=368&width=371&top_left_y=521&top_left_x=748)

Since the cube has six faces, and each face has four of these cubes, we have, in total, $4 \times 6=24$ small cubes with only one face painted red.

b) On each face of the cube, the small cubes that end up with two faces painted red are the eight that have only one edge contained in some edge of the large cube. The figure below illustrates which these cubes are.

![](https://cdn.mathpix.com/cropped/2024_05_01_d18780f0fd52e0502cf8g-40.jpg?height=360&width=371&top_left_y=1259&top_left_x=748)

Note that these small cubes are counted twice, once for each face of the large cube to which they belong. Therefore, we have a quantity of $\frac{8 \times 6}{2}=24$ small cubes that end up with two faces painted red.

c) In a cube of side $n$, the cubes that will end up with no face painted red are those that are part of the sub-cube of side $n-2$ that remains when we remove all the small cubes from the surface of the original cube. Since the sub-cube of side $n-2$ is made up of $(n-2)^{3}$, we then have that the number of small cubes with no face painted is equal to $(n-2)^{3}$.

Following the same reasoning as in item $b$), we have that, on each face of the cube of side $n$, there are $4 \times(n-2)$ small cubes with exactly two faces painted red. Again, they are counted twice, once for each face of the cube of side $n$ to which they belong. Thus, there are $\frac{4 \times(n-2) \times 6}{2}$ small cubes with exactly two faces painted red.

Since the number of small cubes that ended up with no face painted red is equal to three times the number of small cubes that ended up with two faces painted red, we have that

$$
(n-2)^{3}=3 \times\left[\frac{4 \times(n-2) \times 6}{2}\right]
$$

Since the new cube that Aline has is larger than the cube she had previously, it holds that $n>2$, so we can simplify the equation to get:

$$
(n-2)^{2}=\frac{3 \times 4 \times 6}{2}=36
$$

Taking the square root of both sides, we get $n-2=6$, so we have $n=8$.