Reverse factorial function Given a number n, find x such that x! = n, where both x and n are positive integers. Assume the input n will always be the factorial of a positive integer, so something like n=23 will not be given as input.

Examples: n=1 -&gt; x=1 (0 is not a positive integer), n=24 -&gt; x=4

Shortest code wins.
Python 2, 28 bytes (input \$\leq2^{64}\$)



lambda n:len(`n**8L`)**.6//1


Try it online!

This works on inputs up to \$20! =2432902008176640000 \$ that fall within 64-bit integers. 

This uses an approximate fit inspired by Stirling's approximation. However, the constants were estimated manually and it breaks down for larger values. With Python not having a built-in log, we use the digit-length for \$n^8\$ as an approximation for \$c\cdot\log(n)\$. Actually, we use the long value 8L so that the string representations uniformly end in L for "long", which adds one to the lengths.

From there, raising the value to the power of \$0.6\$ and taking the integer part is apparently sufficient to give the correct output up to \$20!\$. It's lucky that the 0.6 is 0.60, since we'd usually need another digit of precision.