ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 02 Nov 2017 04:19:30 +0100Can Sage simplify factorials?https://ask.sagemath.org/question/39369/can-sage-simplify-factorials/I am starting out with Sage and am playing around with some simple equations involving factorials. I have not been able to find a way for Sage to simplify the equations. Does anyone know how, if possible, this is done? The set up is:
sage: var("x, y, z")
(x, y, z)
sage: eq1 = x^2 - y^2 == 0
sage: solve(eq1, x, y)
([x == -y, x == y], [1, 1])
sage: eq2 = factorial(x) - factorial(y) == 0
sage: solve(eq2, x, y)
([factorial(x) == factorial(y)], [1])
sage: eq2.simplify()
factorial(x) - factorial(y) == 0
sage: eq2.simplify_factorial()
factorial(x) - factorial(y) == 0
sage: eq2.simplify_full()
factorial(x) - factorial(y) == 0
As you can see sage can handle polynomials in eq1 but does not seem to recognise that x == y is a solution for eq2. I have tried adding some assume commands in to restrict to positive integers but this does not help. I have not been able to find anything in the documentation so far about this seemingly simple situation which must occur frequently so if anyone has any suggestions please let me know.burrobertThu, 02 Nov 2017 04:19:30 +0100https://ask.sagemath.org/question/39369/