# Describe the set of odd primes such that $\left(\frac{-5}{p}\right) = 1$ (Legendre Symbol)

Okay, so $\left(\frac{-5}{p}\right) = 1$. I am assuming that I can start this by saying $\left(\frac{-5}{p}\right) = \left(\frac{5}{p}\right) \times \left(\frac{-1}{p}\right)$.

There are well defined rules for $\left(\frac{-1}{p}\right)$. Such that if I want $\left(\frac{-1}{p}\right) = 1$, then I must have $p \equiv 1$ mod $4$.

Since $5$ is congruent to $1$ mod $4$, I can say $\left(\frac{5}{p}\right) = \left(\frac{p}{5}\right)$.

So now I must find $p$ such that $\left(\frac{p}{5}\right) = 1$. By quadratic reciprocity I can find that $\left(\frac{p}{5}\right) = 1$ when $p \equiv \{1,4\}$ mod $5$.

By CRT I get $p \equiv \{1,9\}$ mod $20$.

I must also consider the case when both $\left(\frac{-1}{p}\right) = -1$ and $\left(\frac{p}{5}\right) = -1$.

$\left(\frac{-1}{p}\right) = -1$ when $p \equiv 3$ mod $4$.

$\left(\frac{p}{5}\right) = -1$ when $p \equiv \{2,3\}$ mod $5$.

So by CRT I get $p \equiv \{3,7\}$ mod $20$.

So I am assuming it would be safe to say that $\left(\frac{-5}{p}\right) = 1$ when $p \equiv \{1,3,7,9\}$ mod $20$.

Is there anything wrong with this? Or is there a more obvious and faster way to accomplish this?

• Basically OK. It is not by quadratic reciprocity that we find that $(p/5)=1$ when $p$ is congruent to $1$ or $4$ modulo $5$, it is by direct easy calculation. Reciprocity is used in the assertion that $(5/p)=(p/5)$. There is no really faster way. – André Nicolas May 7 '15 at 6:00

$\left(\frac{-5}{p}\right)=\left(\frac{-1}{p}\right)\left(\frac{5}{p}\right)=(-1)^{\frac{p-1}{2}}\left(\frac{5}{p}\right)\stackrel{\text{QR}}=(-1)^{\frac{p-1}{2}}\left(\frac{p}{5}\right)$

$(-1)^{\frac{p-1}{2}}=\begin{cases}1, &p\equiv 1\pmod{\!4}\\-1, &p\equiv -1\pmod{\!4}\end{cases}$

$0^2\equiv \color{#0bc}{0},\ 1^2\equiv \color{#0bc}{1},\ 2^2\equiv\color{#0bc}{4},\ 3^2\equiv (-2)^2\equiv 2^2,\ 4^2\equiv 1^2\pmod{\!5}.$

$\left(\frac{p}{5}\right)=\begin{cases}1, &p\equiv \{\color{#0bc}{1},\color{#0bc}{4}\}\pmod{\!5}\\-1, &p\equiv \{2,3\}\pmod{\!5}\\ 0, &p\equiv \color{#0bc}{0}\pmod{\!5}\end{cases}$

Notice that above didn't use QR but used basic checking, like André said in a comment.

$(-1)^{\frac{p-1}{2}}\left(\frac{p}{5}\right)=\left\{\begin{array}{}1,\ \ \ \ \left\{\left\{\begin{array}{}p\equiv 1\pmod{\!4},\ &p\equiv \{1,4\}\pmod{\!5}\\p\equiv -1\pmod{\!4},\ &p\equiv \{2,3\}\pmod{\!5}\end{array}\right\}\right\}\\-1,\ \left\{\left\{\begin{array}{}p\equiv 1\pmod{\!4},\ &p\equiv \{2,3\}\pmod{\!5}\\p\equiv -1\pmod{\!4},\ &p\equiv \{1,4\}\pmod{\!5}\end{array}\right\}\right\}\\0, \ \ \ \ \ \ \ p\equiv 0\pmod{\!5}\end{array}\right\}$

$\stackrel{\text{CRT}}=\left\{\begin{array}{}1,&p\equiv \{1,3,7,9\}\pmod{\!20}\\-1,&p\equiv \{11,13,17,19\}\pmod{\!20}\\ 0,&p\equiv 0\pmod{\!5}\end{array}\right\}$