For which \$ \$ can several cells (a finite number, greater than zero) be colored black on a white square grid so that on any grid vertical, horizontal, and diagonal line there are either exactly $\$ k \$$ black cells or no black cells at all?

#
Consider the set of cells $ each column intersects $ Consider the set $ obtained by translating the previous one by the vector $(k, 0) $. Thus, $

![](https://cdn.mathpix.com/cropped/2024_05_06_f4319cad953e6ec80578g-24.jpg?height=63&width=2032&top_left_y=483&top_left_x=-1)
each row intersects $ cells, and each diagonal intersects 0 or 1 cell (since no diagonal intersects two copies of $A_1$ in $A_2$).

The set $ $(\mathrm{k} \wedge 2, \mathrm{k} \wedge 2) $$. Any row, column, or diagonal parallel to the vector $(1,-1) $, intersects no more than one copy of $A_2$ in $, and any diagonal parallel to the vector $(1,1) $, intersects 0 or $ k $ cells from $, one cell.

Similarly, construct the set $ 2 _4 $: it consists of $ k $ copies of $ A _3 $, each obtained by translating the previous one by the vector $(\mathrm{k} \wedge 3,-\mathrm{k} \wedge 3) $. Any row, column, or diagonal parallel to the vector $(1,1) $, intersects no more than one copy of $ _ {-} 3 $ in $ 4 _4 $, and any diagonal parallel to the vector $(1,-1) $, either does not intersect any or intersects all copies. Therefore, any row, column, or diagonal intersects $A_4$ by 0 or $ k $ cells.

Remark. The resulting example can be considered as a projection of the nodes of a $ 4 $-dimensional cube $ k|t| \times ~ k l t i m e s$ kltimes $\mathrm{k} $ onto a plane.

## Answer

For any $ k $.