Solving equations with factorials? I looked on the internet but couldn't find anything relevant, so I was hoping you could help because I have no clue where to even start with how to solve this equations:
x! = 6
Obviously trial and error here could work, but is there any way to do it for examples where trial and error would take too long?
Thanks.
 A: Using the Stirling approximation
$$n!\approx \sqrt{2\pi n}\left(\frac ne\right)^n$$
or in logarithms,
$$\ln(n!)\approx\frac{\ln(2\pi n)}2+n(\ln(n)-1)=\ln(N),$$
which you can solve for $n$ by numerical methods.
A crude starting approximation is
$$\frac{\ln(N)}{\ln(\ln(N))}.$$

For instance, solving for $N=14!$ yields $n=14.0022249374875\cdots$. No so bad.
A: Unfortunately there is not simple inverse of the factorial (gamma) function.  Here are some methods that you can try however none of them are perfect.


*

*Start dividing by 2, then 3... until you get 1.

*Find the inverse of one of the factorial approximations.  From there you can plug $x!$ into the inverse and check around the result to find your answer.

*I believe there is a series expansion of the gamma function around the fix points that could also be reversed and used as above however I would guess that is more work than it is worth.

*To simplify the guess and check method you can find a lower bound for the gamma function (there are a bunch) and use that to simplify your search.
$f^{-1}(a)$ is the smallest number that does not evenly divide a given that a is of the form $x!$.  You can use this with 4 to limit your search range so that it can be done quickly.
A: The sequence of factorials is strictly increasing, so there is at most one solution.
$3!=6$, so $x=3$ is the only solution.
