9.7. In a white $2016 \times 2016$ table, some cells are painted black. We will call a natural number $k$ successful if $k \leqslant 2016$, and in each of the grid squares with side $k$ located in the table, exactly $k$ cells are painted. (For example, if all cells are black, then only the number 1 is successful.) What is the maximum number of numbers that can be successful?

( B. Bakayev)
Answer: 1008 numbers.

Solution. Consider an arbitrary coloring of the table. Let there be at least two successful numbers, and let $a$ be the smallest of them, and $b$ be the largest.

Divide $b$ by $a$ with a remainder: $b = qa + r$, where $0 \leq r < a$. If $r \neq 0$, then the number $qa$ is also successful, and $a < qa < b$. Since $r < a$, we have $(q+1)a > qa + r = b$; thus, in the square $b \times b$, there will be more than $b$ black cells, which is impossible. Therefore, $q < 2$, which means $b < 2a$.

The total number of successful numbers does not exceed the number of natural numbers from $a$ to $b$, that is, it is no more than $b - a + 1 < b - b/2 + 1 = b/2 + 1 \leq 1009$. Thus, this number is no more than 1008.

It remains to provide an example of a coloring for which there are 1008 successful numbers. Color black all the cells in the 1008th row and only them. Consider an arbitrary square with side $d \geq 1009$. It intersects with the 1008th row, so it contains a whole row of marked cells, which means there are exactly $d$ of them. Thus, all numbers from 1009 to 2016 are successful, and there are exactly 1008 such numbers.

Comment. Only the answer - 0 points.

Provided an example with 1008 successful numbers - 2 points.

Proved only that the number of successful numbers is no more than 1008 - 4 points.