IMC 2024, Day 1, Problem 3
For which positive integers does there exist an matrix whose entries are all in , such that is the matrix of all ones?
Original from the official PDF

This transcription was compared symbol by symbol with the original, but not yet by a person.
Work for at least 45 minutes before opening the solution.
Official solution
(proposed by Alex Avdiushenko, Neapolis University Paphos, Cyprus)
Hint: Let be the matrix with all ones. Consider .
Solution. Answer: Such a matrix exists if and only if is a complete square.
Let be the matrix with all ones, so . Consider the equality
In the matrix , all columns are equal to the sum of colums in , that is, the th entry in is the number of ones in the th row of . Similarly, the th entry in is the number of ones in the th column of . These numbers must be equal, so contains the same number of ones in every row and every column. Let this common number be ; then .
Now from
It remains to show an example for a matrix of order . For , let be the matrix whose th entry is if and otherwise, i.e., can be obtained from the identity matrix by cyclically shifting the colums times, and let
The th block in is
Transcribed from the official solutions, pages 3–4. This transcription has not been checked a second time; if in doubt, look at the original.
Archive problem: the statement is the official text (transcribed, with the original above). Subject classification and difficulty were estimated automatically; hints and a worked solution are added over time.
How did it go?
Moves you mark come back sooner in triage.