Generate a $5 × 5$ matrix such that the each entry is an integer between $1$ and $9$, inclusive, and whose determinant is divisible by $271$.

Let $\overline{a_{i1}a_{i2}a_{i3}a_{i4}a_{i5}}$, $i \leq 1 \leq 5$ be five distinct five digit multiples of $271$ which have non-zero digits. We claim that the matrix $a_{ij}$ has a determinant divisible by $271$. That is, if we have the matrix whose rows are the multiples of $271$, then it has a determinant divisible by $271$.

The proof is rather clever, really : note that determinants are preserved under column addition and subtraction operations. Therefore, if $C_i$ are the columns, perform $C_5 \to 10000C_1 + 1000C_2 + 100C_3 + 10C_4 + C_5$. Performing this, the determinant does not change, but now, $(C_5)_j = 10^4 a_{j1} + 10^3 a_{j2} + .. = \overline{a_{j1} a_{j2}...a_{j5}}$, for all $1 \leq j \leq 5$. Hence, the column $C_5$ consists completely of multiples of $271$. By multilinearity of the determinant, it follows that the determinant of the matrix is divisible by $271$.

I am sure that you can easily find five multiples of $271$ which satisfy the situation, and furthermore give a non-zero determinant, divisible by $271$.

Take these multiples : $99728,98915,66666,31436,48238$, and form the matrix: $$ \begin{pmatrix} 9\quad 9 \quad 7 \quad 2 \quad 8 \\ 9 \quad 8 \quad 9 \quad 1 \quad 5 \\ 6 \quad 6 \quad 6 \quad 6 \quad 6 \\ 3 \quad 1 \quad 4 \quad 3 \quad 6 \\ 4 \quad 8 \quad 2 \quad 3\quad 8\\ \end{pmatrix} $$ which has determinant $-1626 = 271 \times -6$. Interestingly enough, if you write $11111$ above instead of $66666$, and swap two rows, you will get exactly $271$ as the determinant.


If you make all the entries $1$, then the determinant is $0$, which is divisible by $271$.

courtesy of @ Daniel Schepler