sqrt_mod(a, p) returns one root of x^2 = a (mod p), at most p / 2, or
NULL; all_roots = TRUE returns every root in increasing order.
sqrt_mod_iter(a, p) returns every root in the order SymPy's iterator
produces them. quadratic_residues(p) lists the squares modulo p, and
is_quad_residue(a, p) tests one.
Usage
sqrt_mod(a, p, all_roots = FALSE)
sqrt_mod_iter(a, p, domain = NULL)
quadratic_residues(p)
is_quad_residue(a, p)Arguments
- a
An integer.
- p
Modulus.
- all_roots
Return all roots.
- domain
Function applied to each root, for example
Integer().