# Legendre symbol $(-21/p)$

I am a bit confused with the question:

For what prime $p$, $\left(\frac{-21}{p}\right) = 1$?

I did something like that:

$$\left(\frac{-21}{p}\right) = \left(\frac{-1}{p}\right)\left(\frac{3}{p}\right)\left(\frac{7}{p}\right).$$

But I don't have any ideas what to do next. Thanks for any help.

• Quadratic reciprocity rule may help for this. – coffeemath Jun 20 '16 at 1:37
• yeah, but i dont quite get it. So i write: for $(\frac{-1}{p})$ = $(-1)^\frac{p-1}{2}$ for $(\frac{3}{p})$ = $\frac{p}{3}$ * $(-1)^p-1$ for $(\frac{7}{p})$ = $(\frac{p}{7})$ * $(-1)^(\frac{p-1}{3})$ – Sleppy Jun 20 '16 at 1:39
• Have you found a statement of quadratic reciprocity for two odd primes $p,q$? If not it's likely there's a Wiki article on it, – coffeemath Jun 20 '16 at 1:43
• This section already contains $\left(\frac{-1}p\right)$ and $\left(\frac3p\right)$ – Kenny Lau Jun 20 '16 at 1:45
• okay, but how can i combine two conditions for -1 and 3? – Sleppy Jun 20 '16 at 1:48

Let $p$ be an odd prime not equal to $7$.

If $p\equiv 1\pmod{4}$, then $(7/p)=(p/7)$. But $(p/7)=1$ if $p\equiv 1,2,4\pmod{7}$. That gives, modulo $28$, $p\equiv 1, 9, 25$.

If $p\equiv 3\pmod{4}$, then $(7/p)=-(p/7)$. But $(p/7)=-1$ if $p\equiv 3,5,6\pmod{7}$. That gives, modulo $28$, $p\equiv 3, 19, 27$.

Now we can write down the $6$ congruence classes modulo $28$ for which $(7/p)=-1$.

It is not hard to show (and has been done more than once on MSE) that $(-3/p)=1$ if and only if $p\equiv 1\pmod{3}$.

Now we have a largish number of "Chinese Remainder Theorem" problems to solve modulo $84$. For we must combine the $6$ possibilities for $(7/p)=1$ with $p\equiv 1\pmod{3}$, and the $6$ possibilities for $(7/p)=-1$ with $p\equiv 2\pmod{3}$. All of them are pretty quick, but there are $12$.

A part of this information is on page 36 in the first edition of Cox. Then the table on page 60. Still, takes a bit of digging to find all this.

Other than $2,3,7,$ the primes in question are $$1, 5, 11, 17, 19, 23, 25, 31, 37, 41, 55, 71 \pmod {84}$$ All of them can be written in one of four ways,
$$p = x^2 + 21 y^2,$$ $$p = 2 x^2 + 2 x y + 11 y^2,$$ $$p = 3x^2 + 7 y^2,$$ $$p = 5 x^2 + 4 x y + 5 y^2.$$ As you can see, the primes $2,3,7$ can also be written in one of the four ways, however they are not relatively prime to $-84.$

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$./classGroup Absolute value of discriminant? 84 Discr -84 = 2^2 * 3 * 7 class number 4 all 84: < 1, 0, 21> Square 84: < 1, 0, 21> 84: < 2, 2, 11> Square 84: < 1, 0, 21> 84: < 3, 0, 7> Square 84: < 1, 0, 21> 84: < 5, 4, 5> Square 84: < 1, 0, 21> squares 84: < 1, 0, 21> Discriminant -84 h : 4 Squares : 1 jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./primego
Input three coefficients a b c for positive f(x,y)= a x^2 + b x y + c y^2
1 0 21
Discriminant  -84

Modulus for arithmetic progressions?
84
Maximum number represented?
1500

1,     37,    109,    193,    277,    337,    373,    421,    457,    541,
613,    673,    709,    757,    877,   1009,   1033,   1093,   1117,   1129,
1201,   1213,   1297,   1381,   1429,   1453,

1   25   37

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./primego
Input three coefficients a b c for positive f(x,y)= a x^2 + b x y + c y^2
2 2 11
Discriminant  -84

Modulus for arithmetic progressions?
84
Maximum number represented?
1500

2,     11,     23,     71,    107,    179,    191,    239,    263,    347,
359,    431,    443,    491,    599,    659,    683,    743,    827,    863,
911,    947,   1019,   1031,   1103,   1163,   1187,   1283,   1367,   1439,
1451,   1499,

2   11   23   71

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./primego
Input three coefficients a b c for positive f(x,y)= a x^2 + b x y + c y^2
3 0 7
Discriminant  -84

Modulus for arithmetic progressions?
84
Maximum number represented?
1500

3,      7,     19,     31,    103,    139,    199,    223,    271,    283,
307,    367,    439,    523,    607,    619,    643,    691,    727,    787,
811,    859,   1039,   1063,   1123,   1231,   1279,   1291,   1399,   1447,
1459,   1483,

3    7   19   31   55

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./primego
Input three coefficients a b c for positive f(x,y)= a x^2 + b x y + c y^2
5 4 5
Discriminant  -84

Modulus for arithmetic progressions?
84
Maximum number represented?
1500

5,     17,     41,     89,    101,    173,    257,    269,    293,    353,
461,    509,    521,    593,    677,    761,    773,    797,    857,    881,
929,    941,   1013,   1049,   1097,   1109,   1181,   1193,   1217,   1277,
1301,   1361,   1433,

5   17   41

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus\$