Problem

Source: 2019 CSMO Grade 11 P4

Tags: combinatorics, Bashing, matrix



Let $X$ be a $5\times 5$ matrix with each entry be $0$ or $1$. Let $x_{i,j}$ be the $(i,j)$-th entry of $X$ ($i,j=1,2,\hdots,5$). Consider all the $24$ ordered sequence in the rows, columns and diagonals of $X$ in the following: \begin{align*} &(x_{i,1}, x_{i,2},\hdots,x_{i,5}),\ (x_{i,5},x_{i,4},\hdots,x_{i,1}),\ (i=1,2,\hdots,5) \\ &(x_{1,j}, x_{2,j},\hdots,x_{5,j}),\ (x_{5,j},x_{4,j},\hdots,x_{1,j}),\ (j=1,2,\hdots,5) \\ &(x_{1,1},x_{2,2},\hdots,x_{5,5}),\ (x_{5,5},x_{4,4},\hdots,x_{1,1}) \\ &(x_{1,5},x_{2,4},\hdots,x_{5,1}),\ (x_{5,1},x_{4,2},\hdots,x_{1,5}) \end{align*}Suppose that all of the sequences are different. Find all the possible values of the sum of all entries in $X$.