4. On an $8 \times 8$ board, there is a beetle on each square. At a certain moment, the distribution of the beetles on the board changes: each beetle crawls either one square to the left or one square diagonally to the right and down. If a beetle cannot make either move without falling off the board, it stays on its square.

How many squares can become unoccupied at most due to this change?
B4. 29 There is exactly one beetle that does not crawl anywhere, the beetle at the very bottom left. All other beetles must either crawl one square to the left or one square to the right and down. At most two beetles can end up on the same square. On the board below, the beetles are grouped such that beetles within the same group can end up on the same square: for example, the beetle in the top left on the square with an $\mathrm{N}$ can end up on the square with the $\mathrm{N}$ in the second row. However, it is also possible that the beetle $\mathrm{N}$ from the second row ends up with the beetle $\mathrm{N}$ from the third row.

| $\mathrm{N}$ | $\mathrm{O}$ | $\mathrm{P}$ | $\mathrm{Q}$ | $\mathrm{R}$ | $\mathrm{S}$ | $\mathrm{T}$ | $\mathrm{U}$ |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $\mathrm{L}$ | $\mathrm{M}$ | $\mathrm{N}$ | $\mathrm{O}$ | $\mathrm{P}$ | $\mathrm{Q}$ | $\mathrm{R}$ | $\mathrm{S}$ |
| $\mathrm{J}$ | $\mathrm{K}$ | $\mathrm{L}$ | $\mathrm{M}$ | $\mathrm{N}$ | $\mathrm{O}$ | $\mathrm{P}$ | $\mathrm{Q}$ |
| $\mathrm{H}$ | $\mathrm{I}$ | $\mathrm{J}$ | $\mathrm{K}$ | $\mathrm{L}$ | $\mathrm{M}$ | $\mathrm{N}$ | $\mathrm{O}$ |
| $\mathrm{F}$ | $\mathrm{G}$ | $\mathrm{H}$ | $\mathrm{I}$ | $\mathrm{J}$ | $\mathrm{K}$ | $\mathrm{L}$ | $\mathrm{M}$ |
| $\mathrm{D}$ | $\mathrm{E}$ | $\mathrm{F}$ | $\mathrm{G}$ | $\mathrm{H}$ | $\mathrm{I}$ | $\mathrm{J}$ | $\mathrm{K}$ |
| $\mathrm{B}$ | $\mathrm{C}$ | $\mathrm{D}$ | $\mathrm{E}$ | $\mathrm{F}$ | $\mathrm{G}$ | $\mathrm{H}$ | $\mathrm{I}$ |
| $\mathrm{A}$ | $\mathrm{A}$ | $\mathrm{B}$ | $\mathrm{C}$ | $\mathrm{D}$ | $\mathrm{E}$ | $\mathrm{F}$ | $\mathrm{G}$ |

In group $\mathrm{N}$, there are four beetles, which can pair up two by two. In some other groups, there is an odd number of beetles, meaning that in those groups, one beetle will be left alone. This applies to groups T, U (these beetles cannot pair up with any others), D, E, P, Q (in each of these groups, there are three beetles, two of which can pair up, and at least one will be left alone).

Therefore, there are at least 6 squares with only one beetle and thus at most $\frac{1}{2}(64-6)=29$ squares with two beetles. For each square with two beetles, there is also a square that remains empty, so there are at most 29 empty squares. From the explanation above, it follows that it is indeed possible for 29 squares to remain unoccupied.