Problem 1. Let $A=\left(a_{i j}\right)$ be the $n \times n$ matrix, where $a_{i j}$ is the remainder of the division of $i^{j}+j^{i}$ by 3 for $i, j=1,2, \ldots, n$. Find the greatest $n$ for which $\operatorname{det} A \neq 0$.
Solution. We show that $a_{i+6, j}=a_{i j}$ for all $i, j=1,2, \ldots, n$. First note that if $j \equiv 0(\bmod 3)$ then $j^{i} \equiv 0(\bmod 3)$, and if $j \equiv 1$ or $2(\bmod 3)$ then $j^{6} \equiv 1(\bmod 3)$. Hence, $j^{i}\left(j^{6}-1\right) \equiv 0(\bmod 3)$ for $j=1,2, \ldots, n$, and

$$
a_{i+6, j} \equiv(i+6)^{j}+j^{i+6} \equiv i^{j}+j^{i} \equiv a_{i j}(\bmod 3)
$$

or $a_{i+6, j}=a_{i j}$. Consequently, $\operatorname{det} A=0$ for $n \geq 7$. By straightforward calculation, we see that $\operatorname{det} A=0$ for $n=6$ but $\operatorname{det} A \neq 0$ for $n=5$, so the answer is $n=5$.