# Legendre Symbol $\left ( \frac{7}{p} \right ) = \left ( \frac{7}{q} \right )$

I am asked to prove, that if $p\equiv q\mod 28$ then Legendre Symbol $\left ( \frac{7}{p} \right ) = \left ( \frac{7}{q} \right )$

So far I have this

$7\equiv -1\mod 4$ thus $\left ( \frac{7}{p} \right ) = \left ( \frac{p}{7} \right )$ and likewise for $\left ( \frac{q}{7} \right )$

Now obviously $28\equiv 0\mod 7$, but i am unsure how to use this in context. I figure that i must prove that $p\equiv q\mod 7$ and my proof will follow easily from there.

I should also specify that p and q are primes.

• $p=28n+k, q=28m+k, k = 7r +s, \ldots$ – Joffan Apr 30 '15 at 5:22

There are two cases, $p\equiv -1\pmod{4}$ and $p\equiv 1\pmod{4}$. In the first case, $(7/p)=-(p/7)$. But since $q\equiv p\pmod{28}$, we have $q\equiv -1\pmod{4}$, and therefore $(7/q)=-(q/7)$. But since $q\equiv p\pmod{28}$, they are congruent modulo $7$, and therefore $(p/7)=(q/7)$. It follows that $-(p/7)=-(q/7)$ and therefore $(7/p)=(7/q)$.
A similar argument, without the minus signs, can be made in the case $p\equiv 1\pmod{4}$.
• And to understand why the mod 28 condition is necessary (i.e., what happens when $p\equiv -1$ but $q\equiv 1$), consider $p=3, q=17$. – Steven Stadnicki Apr 30 '15 at 5:31
The origin of the modulo 28, and equivalently, modulo $4q$ when looking at $(\frac{p}{q})$ equality for fixed $p$ and varying $q$, can be derived by applying Gauss' lemma. See Using gauss's lemma to find $(\frac{n}{p})$ (Legendre Symbol). There you can find the derivation of $$(\frac{7}{p}) = 1 \iff p \equiv \pm 1, \pm3, \pm9 \mod 28$$ And thus $$p \equiv q \mod 28 \iff (\frac{7}{p}) = (\frac{7}{q})$$