8.4. A rectangular table has 6 rows and 7 columns and includes 42 squares of size $1 \times 1$. In each square, one of the numbers 0 or 1 is written such that for any two different rows, the sums of the numbers written on them are different, and for any two columns, the sums of the numbers written on them are equal. Find the sum of the numbers written in the first column.
Solution. Since the sums of the numbers on the lines are different, it follows that the sum of 7 numbers (0 or 1) written in a line can take only 8 values, namely: $0,1,2,3,4,5,6,7$. Since we have only 6 lines, then two values out of the eight are missing. Let's denote the missing values by $x$ and $y$. Then the sum of all the numbers in the table can be written as:

$$
S=0+1+2+3+4+5+6+7-(x+y)=28-(x+y)=7 k
$$

where $k \in \mathbf{N}$ is the sum of the numbers in any column, including the first.

Since $x+y=28-7 k=7 \cdot(4-k)$, it follows that the sum $x+y$ is a multiple of 7, which shows that $x+y=7$, and $k=3$.

We will show that such a table is possible. The following is an example of filling in the table with 0 and 1, which satisfies the conditions of the statement.

| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 1 | 1 | 1 | 1 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 1 |
| 0 | 0 | 0 | 0 | 0 | 1 | 1 |