TITLE: Quadratic reciprocity for three primes?
QUESTION [8 upvotes]: The quadratic reciprocity law states that for $p_1\ne p_2$ prime, the product $\left(\frac{p_1}{p_2}\right)\left(\frac{p_2}{p_1}\right)$ takes values $1$ or $-1$ depending on whether $p_1$ and $p_2$ satisfy some set of restrictions mod $4$.
Is there a "quadratic reciprocity law for three primes"? I suspect that the answer is negative.

Is it true that for any integers $M>0$, $\varepsilon\in\{-1,1\}$, and $r_1,r_2,r_3$ coprime with $M$, there exist primes $p_1\equiv r_1\pmod M$, $p_2\equiv r_2\pmod M$, and $p_3\equiv r_3\pmod M$ such that
    $$ \left(\frac{p_1}{p_2}\right)\left(\frac{p_2}{p_3}\right)\left(\frac{p_3}{p_1}\right) = \varepsilon ? $$

What about, say, five primes?

REPLY [12 votes]: Turns out the details are easy so I worked them out myself :) The statement in yellow is true.
Let me assume $4\mid M$. Pick $p_2,p_3$ arbitrary satisfying the congruence modulo $M$ (they exist by Dirichlet). Take any $p_1$ which is congruent to $r_1\pmod M$, congruent to $p_2^{-1}\pmod{p_3}$, and such that
$$\left(\frac{p_1}{p_2}\right)=\varepsilon\cdot(-1)^{\frac{r_1-1}{2}\frac{r_3-1}{2}}$$
(which exists by Dirichlet, CRT, and existence of (non)residues modulo $p_2$.) We have
$$\left(\frac{p_2}{p_3}\right)\left(\frac{p_3}{p_1}\right)=\left(\frac{p_2}{p_3}\right)\left(\frac{p_1}{p_3}\right)\cdot(-1)^{\frac{p_1-1}{2}\frac{p_3-1}{2}}=\left(\frac{p_1p_2}{p_3}\right)\cdot(-1)^{\frac{r_1-1}{2}\frac{r_3-1}{2}}=\left(\frac{1}{p_3}\right)\cdot(-1)^{\frac{r_1-1}{2}\frac{r_3-1}{2}}=(-1)^{\frac{r_1-1}{2}\frac{r_3-1}{2}}$$
(second inequality follows since $p_1\equiv r_1,p_3\equiv r_3\pmod 4$), so multiplying by $\left(\frac{p_1}{p_2}\right)$ leaves $\varepsilon$.