numtheory(deprecated)
legendre
Legendre symbol
Calling Sequence
Parameters
Description
Examples
legendre(a, p)
a
-
integer
p
prime
Important: The numtheory package has been deprecated. Use the superseding command NumberTheory[LegendreSymbol] instead.
The legendre(a, p) function computes the Legendre symbol L⁡ap of a and p, which is defined to be 1 if a is a quadratic residue mod⁢p, −1 if a is a quadratic non-residue mod⁢p, and 0 if a is congruent to 0⁢mod⁢p. The number a is a quadratic residue mod p if it is not a multiple of p and has a square root mod⁢p, that is, there is an integer c such that c2 is congruent to a⁢mod⁢p. The number a is a quadratic non-residue mod p if it is not a multiple of p and does not have a square root mod⁢p.
Note: The legendre routine returns unevaluated if the given algebraic arguments are not of the types specified above.
The command with(numtheory,legendre) allows the use of the abbreviated form of this command.
with⁡numtheory:
legendre⁡74,101
−1
legendre⁡3,73
1
legendre⁡22,11
0
legendre⁡5,2
legendre⁡−2342,1901
legendre⁡a,p
See Also
mod
NumberTheory[LegendreSymbol]
numtheory(deprecated)[jacobi]
numtheory(deprecated)[quadres]
Download Help Document