Ma · Mathematics

Why Is the Legendre Symbol (3/p) Determined by p Modulo 12?

Published By the 9to5Science editorial team

At a glance

  1. 1. Assume p is prime

    For a prime p greater than 3, its residue modulo 12 is 1, 5, 7, or 11.

  2. 2. Apply reciprocity

    Quadratic reciprocity expresses (3/p) using (p/3) and a sign determined by p modulo 4.

  3. 3. Evaluate the cases

    Combine the residues modulo 3 and modulo 4 to get the sign for each of the four classes.

  4. 4. Check with examples

    For instance, 13 gives symbol 1, while 17 gives symbol −1.

Assume throughout that p>3p>3 is a prime. The notation (3p)(\frac{3}{p}) is the Legendre symbol: it is 11 if 3 is a nonzero square modulo pp, and −1-1 if 3 is not a square modulo pp. The claim follows directly from the quadratic reciprocity law, together with the possible prime residues modulo 12.

Why only four residue classes occur

Every prime greater than 3 is odd and is not divisible by 3. Its residue modulo 12 must therefore be relatively prime to 12. The possibilities are

p≡1,5,7,11(mod12).p\equiv 1,5,7,11\pmod{12}.

It remains to evaluate the Legendre symbol in these four cases.

Apply quadratic reciprocity

For distinct odd primes aa and bb, quadratic reciprocity states

(ab)(ba)=(−1)a−12b−12.\left(\frac{a}{b}\right)\left(\frac{b}{a}\right) =(-1)^{\frac{a-1}{2}\frac{b-1}{2}}.

Take a=3a=3 and b=pb=p. Since (3−1)/2=1(3-1)/2=1, this becomes

(3p)=(−1)p−12(p3).\left(\frac{3}{p}\right) =(-1)^{\frac{p-1}{2}}\left(\frac{p}{3}\right).

The symbol (p3)(\frac{p}{3}) is easy to determine: the nonzero squares modulo 3 consist only of 1. Consequently,

(p3)={1,p≡1(mod3),−1,p≡2(mod3).\left(\frac{p}{3}\right)= \begin{cases} 1,&p\equiv 1\pmod{3},\\ -1,&p\equiv 2\pmod{3}. \end{cases}

The other factor depends on whether pp is 1 or 3 modulo 4:

(−1)p−12={1,p≡1(mod4),−1,p≡3(mod4).(-1)^{\frac{p-1}{2}}= \begin{cases} 1,&p\equiv 1\pmod{4},\\ -1,&p\equiv 3\pmod{4}. \end{cases}

So the answer is the product of two signs: one determined by pp modulo 3 and one determined by pp modulo 4.

Evaluate the four cases

pp modulo 12pp modulo 4pp modulo 3(−1)(p−1)/2(-1)^{(p-1)/2}(p/3)(p/3)(3/p)(3/p)
111111
5121−1-1−1-1
731−1-11−1-1
1132−1-1−1-11

For example, if p≡7(mod12)p\equiv 7\pmod{12}, then p≡3(mod4)p\equiv3\pmod4 and p≡1(mod3)p\equiv1\pmod3. The reciprocity sign is −1-1, while (p3)=1(\frac{p}{3})=1, so (3p)=−1(\frac{3}{p})=-1. If p≡11(mod12)p\equiv11\pmod{12}, both factors are −1-1, and their product is 11.

This proves the stated result:

(3p)={1,p≡1,11(mod12),−1,p≡5,7(mod12).\left(\frac{3}{p}\right)= \begin{cases} 1,&p\equiv1,11\pmod{12},\\ -1,&p\equiv5,7\pmod{12}. \end{cases}

Equivalently, among primes greater than 3, the congruence 33 is a square modulo pp exactly when p≡±1(mod12)p\equiv\pm1\pmod{12}.

Worked checks

Take p=13p=13. Since 13≡1(mod12)13\equiv1\pmod{12}, the formula predicts (313)=1(\frac{3}{13})=1. Indeed, 42=16≡3(mod13)4^2=16\equiv3\pmod{13}, so 3 is a square modulo 13.

Take p=17p=17. Since 17≡5(mod12)17\equiv5\pmod{12}, the formula predicts (317)=−1(\frac{3}{17})=-1. The reciprocity calculation gives the same result: 17≡1(mod4)17\equiv1\pmod4, so the sign factor is 1, and 17≡2(mod3)17\equiv2\pmod3, so (173)=−1(\frac{17}{3})=-1. Their product is −1-1.

Common mistakes

  • Forgetting that pp must be prime. The Legendre symbol (3p)(\frac{3}{p}) is defined here for an odd prime denominator. The statement is not a claim about every integer p>3p>3.
  • Using only the residue modulo 3. Quadratic reciprocity also contributes the sign (−1)(p−1)/2(-1)^{(p-1)/2}, which depends on pp modulo 4. Ignoring it gives the wrong answer for classes such as p≡7(mod12)p\equiv7\pmod{12}.
  • Including p=3p=3. Reciprocity in this form uses distinct primes, and the Legendre symbol (33)(\frac{3}{3}) is 0, not 1 or −1-1. The condition p>3p>3 excludes this case.
  • Confusing a Legendre symbol with a congruence. A value of 1 means that some integer xx satisfies x2≡3(modp)x^2\equiv3\pmod p; it does not mean that 3 itself is congruent to a square as an ordinary integer.

References

  1. Kenneth Ireland and Michael Rosen, A Classical Introduction to Modern Number Theory
  2. Ivan Niven, Herbert S. Zuckerman, and Hugh L. Montgomery, An Introduction to the Theory of Numbers

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.