Processing math: 100%
Ask Your Question
0

Simplify factorials Question [closed]

asked 4 years ago

anonymous user

Anonymous

updated 4 years ago

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)
Preview: (hide)

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 ( 4 years ago )

The answer would look like this: (2n+3)(2n+2)(2n+1)(2n)(2n1)(2nn+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 ( 4 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 4 years ago

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)
Preview: (hide)
link

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 719 times

Last updated: Apr 11 '21