For the school olympiad, students from 6.B grade created a pyramid of winners from wooden cubes, see the image. How many cubes did they use in total?

![](https://cdn.mathpix.com/cropped/2024_04_17_f803abc88728297ab2efg-6.jpg?height=280&width=674&top_left_y=1813&top_left_x=725)

The assembled pyramid was painted white on the entire surface (except for the base) and after the results were announced, they dismantled their creation. How many cubes had 6, how many 5, 4, 3, 2, 1, or no sides painted white?

(M. Dillingerová, M. Volfová)
For the second level, a total of $4 \cdot 4 \cdot 3=48$ cubes are needed, for the first $4 \cdot 4 \cdot 4=64$, and for the third $4 \cdot 4 \cdot 2=32$. Therefore, the students used a total of

$$
48+64+32=144
$$

cubes.

The number of cubes that have no white faces is in the first (bottom) layer $10 \cdot 2=20$, in the second layer $7 \cdot 2=14$, in the third layer $3 \cdot 2=6$, and in the fourth layer none; in total,

$$
20+14+6=40 \text {. }
$$

The number of cubes that have exactly one white face is in the front/back walls $10+7+3=20$, in the side walls $4+2+2=8$ (counted from left to right), and in the top walls $6+4+6=16$; in total,

$$
20 \cdot 2+8+16=64 .
$$

The number of cubes that have exactly two white faces is on the longitudinal edges $2 \cdot(3+2+3)=16$, on the transverse edges $4 \cdot 2=8$, and on the vertical edges $4+2+2=8$; in total,

$$
16+8+8=32 \text {. }
$$

The number of cubes that have three white faces is exactly 8, and no cube has more than three faces colored.

For verification, we compare the results from both parts of the discussion:

$$
144=40+64+32+8 \text {. }
$$

Note. For a different system in solving a similar problem, see problem Z7-I-4.