A Quadratic Residue
Let p be an odd prime and a an integer not divisible by p.
We say that a is a quadratic residue of p when
x2 ≡ a (mod p)
has at least one solution and a quadratic non-residue other wise.
The Legendre Symbol
The Legendre Symbol (a/p)
is defined by:
The number of incongruent solutions to x2 ≡ a (mod p)
is 1+(a/p)