Python | sympy.factorint() method Last Updated : 05 Sep, 2019 Comments Improve Suggest changes Like Article Like Report With the help of sympy.factorint() method, we can find the factors and their corresponding multiplicities of a given integer. For input less than 2, factorint() behaves as follows: factorint(1) - returns the empty factorization {}. factorint(0) - returns {0:1}. factorint(-n) - adds -1:1 to the factors and then factors n. Syntax: factorint(n) Parameter: n - It denotes an integer. Returns: Returns a dictionary containing the prime factors of n as keys and their respective multiplicities as values. Example #1: Python3 # import factorint() method from sympy from sympy import factorint n = 2**3 * 3**4 * 5**6 # Use factorint() method factor_dict = factorint(n) print("Dictionary containing factors of {} with respective multiplicities : {}". format(n, factor_dict)) Output: Dictionary containing factors of 10125000 with respective multiplicities : {2: 3, 3: 4, 5: 6} Example #2: Python3 # import factorint() method from sympy from sympy import factorint n = 6**4 * 13 # Use factorint() method factor_dict = factorint(n) print("Dictionary containing factors of {} with respective multiplicities : {}". format(n, factor_dict)) Output: Dictionary containing factors of 16848 with respective multiplicities : {2: 4, 3: 4, 13: 1} Comment More infoAdvertise with us Next Article Python | sympy.factorint() method R rupesh_rao Follow Improve Article Tags : Python Practice Tags : python Similar Reads Python | sympy.factor() method With the help of sympy.factor() method, we can find the factors of mathematical expressions in the form of variables by using sympy.factor() method. Syntax : sympy.factor(expression) Return : Return factor of mathematical expression. Example #1 : In this example we can see that by using sympy.factor 1 min read Python | sympy.factorial() method With the help of sympy.factorial(), we can find the factorial of any number by using sympy.factorial() method. Syntax : sympy.factorial() Return : Return factorial of a number. Example #1 : In this example we can see that by using sympy.factorial(), we are able to find the factorial of number that i 1 min read Python | sympy.factor_list() method With the help of sympy.factor_list() method, we can get a list of factors of a mathematical expression in SymPy in the form of (factor, power) tuple. Syntax: factor_list(expression) Parameters: expression - It is a mathematical expression. Returns: Returns a list of factors of the given mathematical 2 min read Python | sympy.factorial2() method With the help of sympy.factorial2() method, we can find the Double factorial. Double factorial of a number is given by - n!! = \begin{cases} 1 & n = 0 \\ n(n-2)(n-4) \cdots 1 & n\ \text{positive odd} \\ n(n-2)(n-4) \cdots 2 & n\ \text{positive even} \\ (n+2)!!/(n+2) & n\ \text{negati 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