Problem

Source: Baltic Way 2017 Problem 18

Tags: number theory, abstract algebra



Let $p>3$ be a prime and let $a_1,a_2,...,a_{\frac{p-1}{2}}$ be a permutation of $1,2,...,\frac{p-1}{2}$. For which $p$ is it always possible to determine the sequence $a_1,a_2,...,a_{\frac{p-1}{2}}$ if it for all $i,j\in\{1,2,...,\frac{p-1}{2}\}$ with $i\not=j$ the residue of $a_ia_j$ modulo $p$ is known?