Problem

Source: Turkey Olympic Revenge 2024 P1

Tags: combinatorics



Let $m,n$ be positive integers. An $n\times n$ board has rows and columns numbered $1,2,\dots,n$ from left to right and top to bottom, respectively. This board is colored with colors $r_1,r_2,\dots,r_m$ such that the cell at the intersection of $i$th row and $j$th column is colored with $r_{i+j-1}$ where indices are taken modulo $m$. After the board is colored, Ahmet wants to put $n$ stones to the board so that each row and column has exactly one stone, also he wants to put the same amount of stones to each color. Find all pairs $(m,n)$ for which he can accomplish his goal. Proposed by Sena Başaran