Solution (source code)

= Solution

For distinct <odd primes> $p,q$, the <quadratic reciprocity> law is
$$
\boxed{(p/q)(q/p)=(-1)^{\frac{p-1}{2}\frac{q-1}{2}}.}
$$
Thus the two symbols have opposite signs exactly when both primes are three modulo four; otherwise they agree. Distinctness excludes zero symbols.