Ask Your Question
0

Simplify factorials Question [closed]

asked 2021-04-10 17:50:56 +0200

anonymous user

Anonymous

updated 2021-04-10 19:26:24 +0200

vdelecroix gravatar image

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 flag offensive 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

Comments

Could you develop on what you mean by "the answer"?

vdelecroix gravatar imagevdelecroix ( 2021-04-10 19:26:56 +0200 )edit

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.

b@nnon.us gravatar imageb@nnon.us ( 2021-04-10 23:36:57 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-11 16:01:59 +0200

slelievre gravatar image

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)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-04-10 17:38:56 +0200

Seen: 68 times

Last updated: Apr 11