Python | sympy.gcd() method Last Updated : 02 Aug, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of sympy.gcd() method, we can find the greatest common divisor of two numbers that is passed as a parameter in the sympy.gcd() method. Syntax : sympy.gcd(var1, var2) Return : Return value of greatest common divisor. Example #1 : In this example we can see that by using sympy.gcd() method, we are able to find the greatest common divisor of any two numbers that is passed as parameters. Python3 1=1 # import sympy from sympy import * # Using sympy.gcd() method gfg = gcd(6, 8) print(gfg) Output : 2 Example #2 : Python3 1=1 # import sympy from sympy import * # Using sympy.gcd() method gfg = gcd(177, 81) print(gfg) Output : 3 Comment More infoAdvertise with us Next Article Python | sympy.gcd() method J jitender_1998 Follow Improve Article Tags : Python SymPy Practice Tags : python Similar Reads Python | sympy.igcd() method With the help of sympy.igcd() method, we can find the greatest common divisor of two nonnegative integer numbers that is passed as a parameter in the sympy.igcd() method. Syntax : sympy.igcd(var1, var2) Return : Return value of greatest common divisor for nonnegative integer. Example #1 : In this ex 1 min read Python | sympy.lcm() method The function lcm() provides the direct way to compute Least Common Multiple for polynomials.That is, for polynomials f and g, it computes LCM. Syntax: sympy.lcm(f, g) Return: LCM of given polynomials Example #1: Python3 1== # import sympy from sympy import * f = x * y**2 + x**2 * y g = x**2 * y**2 # 1 min read Python | sympy.lcm() method With the help of sympy.lcm() method, we can find the least common multiple of two numbers that is passed as a parameter in the sympy.lcm() method. Syntax : sympy.lcm(var1, var2) Return : Return value of least common multiple. Example #1 : In this example we can see that by using sympy.lcm() method, 1 min read Python | sympy.crt() method With the help of sympy.crt() method, we can implement the Chinese Remainder Theorem in SymPy. Syntax: crt(m, v) Parameter: m - It denotes a list of integers. v - It denotes a list of integers. Returns: Returns a tuple of integers where the first element is the required result. Example #1: Python3 # 1 min read Python | sympy.core() method With the help of sympy.core() method, we can calculate the core_t(n) of a positive integer n. core(n, t) calculates the t-th power free part of n. If nâs prime factorization is : n = \prod_{i=1}^\omega p_i^{m_i} then core_t(n) = \prod_{i=1}^\omega p_i^{m_i \mod t} Syntax: core(n, t=2) Parameter: n - 1 min read Like