# Given a Factorial number , find the next Factorial number [duplicate]

The Factorial sequence is 1,1,2,6,24,120,720,5040,…, where 0! = 1, 1!=1, 2! = 1*2 = 2, 3! = 1*2*3,.....

Can we find the next Factorial number if we are given any Factorial number?

For example, if n=120 then the answer should be 720 because 720 is the next Factorial number after 120.

• This just amounts to finding n if you know n!. See e.g. quora for some efficient algorithms. Or search for "inverse factorial function". – Abhimanyu Pallavi Sudhir Mar 8 at 9:03

$$n! =y\implies n \sim \frac{{\log \left( {\frac{y}{{\sqrt {2\pi } }}} \right)}}{{W\left( {\frac{1}{e}\log \left( {\frac{y}{{\sqrt {2\pi } }}} \right)} \right)}} -\frac{1}{2}$$ where appears Lambert function.
Use $$\lceil n \rceil$$.