Python | sympy.reduced_totient() method Last Updated : 17 Sep, 2019 Comments Improve Suggest changes Like Article Like Report With the help of sympy.reduced_totient() method, we can find the Carmichael reduced totient function or lambda(n) in SymPy. reduced_totient(n) or \lambda(n) is the smallest m > 0 such that k^m \equiv 1 \mod n for all k relatively prime to n. Syntax: reduced_totient(n) Parameter: n - It denotes an integer. Returns: Returns the smallest integer m > 0 such that km % n is equal to 1 for all k relatively prime to n. Example #1: Python3 # import reduced_totient() method from sympy from sympy.ntheory import reduced_totient n = 8 # Use reduced_totient() method reduced_totient_n = reduced_totient(n) print("lambda({}) = {} ".format(n, reduced_totient_n)) # 1 ^ 2 = 1 (mod 8), 3 ^ 2 = 9 = 1 (mod 8), # 5 ^ 2 = 25 = 1 (mod 8) and 7 ^ 2 = 49 = 1 (mod 8) Output: lambda(8) = 2 Example #2: Python3 # import reduced_totient() method from sympy from sympy.ntheory import reduced_totient n = 30 # Use reduced_totient() method reduced_totient_n = reduced_totient(n) print("lambda({}) = {} ".format(n, reduced_totient_n)) Output: lambda(30) = 4 Comment More infoAdvertise with us Next Article Python | sympy.reduced_totient() method R rupesh_rao Follow Improve Article Tags : Python SymPy Practice Tags : python Similar Reads Python | sympy.totient() method With the help of sympy.totient() method, we can find Euler totient function or phi(n) of a given integer. Euler totient function is the number of positive integers less than or equal to a given integer that are relatively prime to it. In other words, it is the number of integers k in the range 1 1 min read Python sympy | sieve.totientrange() method With the help of sympy.sieve.totientrange() method, we can generate all totient numbers for a given range [a, b). It returns a type generator object which can be converted to a list for further operations. Syntax: sieve.totientrange(a, b) Parameters: a - It denotes the start of the range. It is incl 1 min read Python | sympy.sqrt() method With the help of sympy.sqrt() method, we can find the square root of any number by using sympy.sqrt() method. Syntax : sympy.sqrt(number) Return : Return square root of any number. Example #1 : In this example we can see that by using sympy.sqrt() method, we can get the square root of any number. Py 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.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 Like