numtheory(deprecated)

 check if a number is a quadratic residue mod another

Parameters

 a, b - integer

Description

 • Important: The numtheory package has been deprecated.  Use the superseding command NumberTheory[QuadraticResidue] instead.
 • The function quadres will compute a generalized Legendre symbol $L\left(\frac{a}{b}\right)$ of a and b, which is defined to be 1 if a is a quadratic residue $\mathbf{mod}b$and -1 if a is a quadratic non-residue $\mathbf{mod}p$.  The number a is a quadratic residue mod b if it has a square root $\mathbf{mod}b$;  i.e., an integer c exists such that ${c}^{2}$ is congruent to $a\mathbf{mod}b$.
 • The command with(numtheory,quadres) allows the use of the abbreviated form of this command.

Examples

Important: The numtheory package has been deprecated.  Use the superseding command NumberTheory[QuadraticResidue] instead.

 > $\mathrm{with}\left(\mathrm{numtheory}\right):$
 > $\mathrm{quadres}\left(74,101\right)$
 ${-1}$ (1)
 > $\mathrm{quadres}\left(0,73\right)$
 ${1}$ (2)
 > $\mathrm{quadres}\left(22,11\right)$
 ${1}$ (3)
 > $\mathrm{quadres}\left(5,256\right)$
 ${-1}$ (4)
 > $\mathrm{quadres}\left(-2342,1904\right)$
 ${-1}$ (5)