Python | sympy.factorial2() method Last Updated : 14 Jul, 2019 Comments Improve Suggest changes Like Article Like Report 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{negative odd} \end{cases} Syntax: factorial2(n) Parameter: n - It denotes the number whose double factorial is to be calculated. Returns: Returns the double factorial of number, i. e., n. Example #1: Python3 # import sympy from sympy import * n = 10 print("Value of n = {}".format(n)) # Use sympy.factorial2() method factorial2_n = factorial2(n) print("Double factorial of n : {}".format(factorial2_n)) Output: Value of n = 10 Double factorial of n : 3840 Example #2: Python3 # import sympy from sympy import * n = -3 print("Value of n = {}".format(n)) # Use sympy.factorial2() method factorial2_n = factorial2(n) print("Double factorial of n : {}".format(factorial2_n)) Output: Value of n = -3 Double factorial of n : -1 Comment More infoAdvertise with us Next Article Python | sympy.factorial2() method R rupesh_rao Follow Improve Article Tags : Python SymPy Practice Tags : python Similar Reads 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() 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.factorint() method 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 facto 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.ff() method With the help of sympy.ff() method, we can find the Falling factorial. Falling factorial is defined by - ff(x, k) = x \cdot (x-1) \cdots (x-k+1) where x can be arbitrary expression and k is an integer. Syntax: ff(x, k) Parameter: x - It denotes any arbitrary expression. k - It denotes an integer. Re 1 min read Like