Let $p$ be a prime number satisfying $p>3$ and $k \geqslant 2$. Théo and Vincent play the following game: Théo chooses a permutation $a_{1}, \ldots, a_{k}$ of the integers $1, \ldots, k$, and tells Vincent what $a_{i} a_{j}$ modulo $p$ is for all $i \neq j$. Vincent wins if he can guess the $\left(a_{i}\right)_{1 \leqslant i \leqslant k}$. For which values of $k$ can Vincent win regardless of the permutation chosen by Théo?
Note that if $k \geqslant p+1$, Théo can give $1, \ldots, k$, or swap 1 and $p+1$, without changing the products $a_{i} a_{j}$ modulo $p$, so Vincent cannot win.

If $k=2$, Vincent cannot differentiate $\left(a_{1}, a_{2}\right)=(2,1)$ and $(1,2)$, so he cannot win.

If $3 \leqslant k \leqslant p-2$, Vincent can know $a_{2} / a_{1}$ modulo $p$ because $a_{2} / a_{1} \equiv\left(a_{2} a_{3}\right) /\left(a_{1} a_{3}\right)(\bmod p)$. Since he knows $a_{2} \times a_{1}$ modulo $p$, he therefore knows $\frac{a_{1}}{a_{2}} \times a_{2} a_{1} \equiv a_{1}^{2}$ modulo $p$, so he knows $a_{1}$ up to a sign (he knows that $a_{1}= \pm \alpha$ for some $\alpha$. From this, he can deduce all the $a_{i}$ because he knows $a_{1} \times a_{i}$ modulo $p$. Thus, he can deduce that the $k$-tuple $\left(a_{1}, \ldots, a_{k}\right)$ is either a $k$-tuple of the form $\left(b_{1}, \ldots, b_{k}\right)$ or $\left(-b_{1}, \ldots,-b_{k}\right)$. The true $k$-tuple chosen by Théo contains 1, so the false one contains $p-1>k$ (while the true one does not), so Vincent can determine which one is correct.

If $k=p-1$ or $p$, Vincent cannot differentiate $a_{i}=i$ for all $i$ between 1 and $p-1$ and $a_{i}=p-i$ for all $i$ between 1 and $p-1$ (adding $a_{p}=p$ if $k=p$ in both cases).

The values of $k$ that work are the integers between 3 and $p-2$.