Solution
= Solution
<Gauss lemma (number theory)>[Gauss lemma for quadratic residues] states: for $p\nmid a$, take the least positive residues of $a,2a,\ldots,((p-1)/2)a$ modulo $p$, and let $s$ be the number greater than $p/2$. Then
$$
\boxed{\left(\frac ap\right)=(-1)^s}.
$$