Problem

Source: SMO open 2024 Q5

Tags: combinatorics, primes, grid, number theory, prime numbers



Let $p$ be a prime number. Determine the largest possible $n$ such that the following holds: it is possible to fill an $n\times n$ table with integers $a_{ik}$ in the $i$th row and $k$th column, for $1\le i,k\le n$, such that for any quadruple $i,j,k,l$ with $1\le i<j\le n$ and $1\le k<l\le n$, the number $a_{ik}a_{jl}-a_{il}a_{jk}$ is not divisible by $p$. Proposed by oneplusone