Section 16.6 Introducing the Legendre Symbol
ΒΆConsider the lowly notion of congruence, along with its symbol β‘. It is easy to explain; yet Gauss revolutionized number theory and made it more accessible to others with it. In Legendre's research into questions of residues, he discovered that certain powers were always either Β±1, omitting multiples of what we would today call the modulus. Some of what he found was essentially Theorem 16.5.2. This enabled the great innovation of Legendre's we alluded to earlier. What of the plus or minus 1; why is this so innovative? To quote an article [C.7.5] on this subject, if one has a symbol for it, it becomesIn our modern terms, Legendre takes advantage of the fact that a=gi is an even power exactly when a is a QR, and (β1)i=1 precisely when i is even (and hence precisely when a is a QR). This is the so-called Legendre symbol. (However, he did not use the term QR, just the symbolβ3βUnfortunately, despite the suggestion of βa on pβ for pronouncing it, there does not seem to be a standard way to read this aloud..)β¦ more than a notational convenience β¦ Legendre reifies this concept, and makes it into an object of independent study.
βSteven H. Weintraub
Definition 16.6.1.
We write (ap) for the Legendre symbol. Given that p is an odd prime, for a coprime to p we set
We define the Legendre symbol of a modulo p to be zero if pβ£a.
Example 16.6.2.
We can now restate Fact 16.1.2: We have that (β1p)=1 for p prime if and only if p=2 or pβ‘1 (mod 4).
xxxxxxxxxx
legendre_symbol(-2,11)
xxxxxxxxxx
def _(p=(17,prime_range(50))):
for n in [q for q in quadratic_residues(p) if q != 0]:
pretty_print(html(r"$%s$ is a QR of $%s$ and $\left(\frac{%s}{%s}\right)=%s$"%(n, p, n,p, legendre_symbol(n,p))))
Remark 16.6.3.
A brief note is in order regarding the special status of zero in Definition 16.3.1, especially since Sage includes zero as a QR.
First, this recognizes the special case that only 02=0, while 1=12=(β1)2 (and everything else) usually have two square roots modulo a prime.
A deeper reason is that this status allows us to conveniently ignore the only integer from 0 to pβ1 which is not in Up. In fact, the multiplicative property Proposition 16.4.7 ensures you can consider xβ¦(xp) to be a function from Up to {1,β1} of the kind we call a group homomorphism. (Indeed, it gets us from a cyclic group of order pβ1 to a cyclic group of order 2, with βkernelβ the cyclic subgroup of order (pβ1)/2 that we already mentioned in Theorem 16.4.3.)
xxxxxxxxxx
def _(p=(19,prime_range(100))):
L = [legendre_symbol(a,p) for a in [0..p-1]]
pretty_print(html(r"All Legendre symbols $\left(\frac{a}{%s}\right)$ can be listed:"%p))
print(L)
pretty_print(html("And they sum up to $%s$"%sum(L)))