# Simplify factorials Question [closed] Anonymous

Hi , sorry this may seem so easy but i'm just starting sage !

I want this code to show the answer, how can i do that ? how can i change the code ?

n=var('n)
f=factorial(2*n + 3)/factorial(n + 1)
f.simplify_factorial()


output is :

factorial(2*n + 3)/factorial(n + 1)

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by SoheilK close date 2021-04-19 22:09:36.562492

The answer would look like this: $$(2n+3)(2n+2)(2n+1)(2n)(2n-1) \cdots (2n-n+2)$$ It would have $n+2$ factors. Not very useful, and I am not sure why it's needed.

Sort by » oldest newest most voted

Sage offers various ways to express the desired product, using

• factorial
• gamma
• falling factorial
• rising factorial
• product
• held product

Only the last one seems to keep the desired product expressed as a product of n + 2 terms.

sage: k, n = SR.var('k, n')

sage: factorial(2*n + 3)/factorial(n + 1)
factorial(2*n + 3)/factorial(n + 1)

sage: gamma(2*n + 4)/gamma(n + 2)
gamma(2*n + 4)/gamma(n + 2)

sage: falling_factorial(2*n + 3, n + 2)
gamma(2*n + 4)/gamma(n + 2)

sage: rising_factorial(n + 2, n + 2)
gamma(2*n + 4)/gamma(n + 2)

sage: product(k, k, n + 2, 2*n + 3)
factorial(2*n + 3)/factorial(n + 1)

sage: product(k, k, n + 2, 2*n + 3, hold=True)
product(k, k, n + 2, 2*n + 3)

more