Question 130
Let $A$ be a $m \times m$ matrix. Let $X_{i}$ be the set of entries in the $i$th row and $Y_{j}$ be the set of entries in the $j$th column, $1 \leq i, j \leq m$. $A$ means cool if the quantities $X_{1}, \ldots, X_{m}, Y_{1}, \ldots, Y_{m}$ are all different. Find the smallest value for $n$ so that there is a cool $2005 \times 2005$ matrix with entries from the set $\{1,2, \ldots, n\}$.