Problem

Source: Belarusian National Olympiad 2021

Tags: combinatorics, number theory



In the table $n \times n$ numbers from $1$ to $n$ are written in a spiral way. For which $n$ all the numbers on the main diagonal are distinct?


Attachments: