# Summary

In today's class we covered some applications of quadratic reciprocity, and in particular saw how it could be used to answer whole classes of quadratic congruence questions at once.

# Some Applications of Quadratic Reciprocity

Last class period we gave the following theorem

Theorem (Quadratic Reciprocity): Suppose that

pandqare distinct odd prime numbers. Then we have$\displaystyle \left(\frac{p}{q}\right)\left(\frac{q}{p}\right) = (-1)^{\left(\frac{p-1}{2}\right)\left(\frac{q-1}{2}\right)} = \left\{\begin{array}{rl}1,&\mbox{ if }p \equiv 1 \mod{4} \mbox{ or } q \equiv 1 \mod{4}\\-1,&\mbox{ if }p \equiv q \equiv 3 \mod{4}.\end{array}\right.$

We'll start today by getting a few more nice consequences from this result. To do so, we give an important corollary.

Corollary: Suppose that

pandqare odd primes. Then we have$\displaystyle \left(\frac{p}{q}\right) = \left\{\begin{array}{rl}\left(\frac{q}{p}\right), &\mbox{if either }p \equiv 1 \mod{4}\mbox{ or }q\equiv 1 \mod{4}\\-\left(\frac{q}{p}\right),&\mbox{if both }p \equiv 3 \mod{4} \mbox{ and }q \equiv 3 \mod{4}.\end{array}\right.$.

This follows directly from the Quadratic Reciprocity theorem. To see why that's true, suppose that either $p \equiv 1\ mod{4}$ or $q \equiv 1 \mod{4}$. Then quadratic reciprocity says

(1)Now since every Legendre symbol is either 1 or -1, this means that $\left(\frac{q}{p}\right)^2 = 1$. Multiplying by $\left(\frac{q}{p}\right)$ on both sides of the above equation then gives

(2)A similar argument works when $p \equiv q \equiv 3 \mod{4}$.

#### Example: Is 278 a square mod 467?

Suppose we want to calculate $\left(\frac{278}{467}\right)$. Obviously we don't want to compute all the quadratic residues mod 467, so instead we'll use the rules we know about Legendre symbols. For one, we know that since $278 = 2\cdot 139$ we have

(3)Since $467 \equiv 3 \mod{8}$ we know that the first Legendre symbol is -1. Further, since $139 \equiv 467 \equiv 3 \mod{4}$, quadratic reciprocity tells us that $\left(\frac{139}{467}\right) = -\left(\frac{467}{139}\right)$. Hence we get

(4)To compute this new Legendre symbol, we can reduce $467$ modulo 139. It turns out that $467 \equiv 50 \mod{139}$. Hence we get

(5)The second Legendre symbol is "obviously" 1, since 25 is a perfect square. For the Legendre symbol involving 2, we note that $139 \equiv 3 \mod{8}$ implies that 2 isn't a square mod 139. Hence we get

(6)Hence we see that 278 is not a square mod 467. $\square$

Here's another result that can be handy to carry around.

Corollary: Let

pandqbe odd primes. Then

- if $p \equiv 1 \mod{4}$, then $\displaystyle \left(\frac{p}{q}\right) = \left(\frac{q}{p}\right)$
- if $p \equiv 3 \mod{4}$, then $\displaystyle \left(\frac{p}{q}\right) = (-1)^{\frac{q-1}{2}}\left(\frac{q}{p}\right)$

The first line of this equation is the same as the previous corollary. For the second line, notice that if $p \equiv 3 \mod{4}$ then $(p-1)/2$ is odd. Therefore we have

(7)The same technique we used before then shows that

(8)$\square$

#### Example: When is 7 a square mod *p*?

Suppose we want to characterize all those primes *p* for which 7 is a square. Certainly we have that 7 is a square mod 2, and we also have that 7 is a square mod 7 (since 0 is a square mod 7 — note that I'm saying "square" and not "quadratic residue"!). So suppose that *p* is some odd prime different from 7. We know from quadratic reciprocity that

So we need to know when this quantity is 1 or -1. Notice that the value of the first factor is determined by the congruence of *p* mod 4, whereas the second is determined by its congruence mod *7*. Hence our answer will be determined mod 28. To see which work, we'll just compute the number above for all possible residues mod 28. Notice that we can focus on odd residues since *p* is an odd prime, and we can discard 7 and 21 as possibilities (since *p* isn't 7). It's also helpful to note that the quadratic residue mod 7 are 1,2 and 4.

$p \mod{28}$ | $(-1)^{\frac{p-1}{2}$ | $\left(\frac{p}{7}\right)$ | $\left(\frac{7}{p}\right)$ | $p \mod{28}$ | $(-1)^{\frac{p-1}{2}$ | $\left(\frac{p}{7}\right)$ | $\left(\frac{7}{p}\right)$ |
---|---|---|---|---|---|---|---|

1 | 1 | -1 | -1 | 15 | -1 | 1 | -1 |

3 | -1 | -1 | 1 | 17 | 1 | -1 | -1 |

5 | 1 | -1 | -1 | 19 | -1 | -1 | 1 |

9 | 1 | 1 | 1 | 23 | -1 | 1 | -1 |

11 | -1 | 1 | -1 | 25 | 1 | 1 | 1 |

13 | 1 | -1 | -1 | 27 | -1 | -1 | 1 |

So a prime *p* has 7 as a square if $p=2,7$ or when $p \equiv 3,9,19,25,27$. $\square$