Problem

Source: Spanish Communities

Tags: geometry, rectangle, combinatorics unsolved, combinatorics



We have a grid of $k^2-k+1$ rows and $k^2-k+1$ columns, where $k=p+1$ and $p$ is prime. For each prime $p$, give a method to put the numbers 0 and 1, one number for each square in the grid, such that on each row there are exactly $k$ 0's, on each column there are exactly $k$ 0's, and there is no rectangle with sides parallel to the sides of the grid with 0s on each four vertices.