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?

  • 1
    $\begingroup$ I suspect you can take $p_3$ arbitrary, say $1\pmod 4$, and the pick $p_1,p_2$ with $p_1p_2=1\pmod p_3$. I will let someone else work outtge details though $\endgroup$
    – Wojowu
    Jan 15, 2020 at 19:59
  • $\begingroup$ @Wojowu: I thought of this, but working out the details seems messy (and not clear whether this will eventually work). $\endgroup$
    – Seva
    Jan 15, 2020 at 20:02
  • $\begingroup$ Working out the details may be messy, but you guys with CAS systems and number theory packages should be able to churn out data and then bin it according to residue by computer in moments. That should point you in the right direction. Gerhard "Assuming There Is A Direction" Paseman, 2020.01.15. $\endgroup$ Jan 15, 2020 at 20:09
  • $\begingroup$ @GerhardPaseman: I actually did some computations, which show that $M=48$ does not work: for any given $r_1,r_2,r_3$ co-prime with $48$, and any $\varepsilon\in\{-1,1\}$ there exist primes $p_1,p_2,p_3$ satisfying the condition. $\endgroup$
    – Seva
    Jan 15, 2020 at 20:16

1 Answer 1


Turns out the details are easy so I worked them out myself :) The highlighted statement 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 $$\begin{align*}\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}} \end{align*}$$ (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$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.