The integer functions of sympy.polys.domains.groundtypes, which SymPy
takes from Python or from gmpy2: python_gcd(), python_lcm() and
python_gcdex() (Python's), and gmpy_gcd(), gmpy_lcm(),
gmpy_gcdex(), gmpy_numer(), gmpy_denom() and gmpy_qdiv()
(gmpy2's, here computed with gmp). python_gcdex(a, b) returns
list(x, y, g) with x*a + y*b = g, while gmpy_gcdex(a, b) returns
gmpy2's order list(g, x, y). gmpy_qdiv(x, y) is the exact quotient,
an integer when it is one. sqrtrem(n) returns the integer square root
s and the remainder n - s^2.