An approximation to the factorial function.

N! ~ NN e-N

or, in logarithmic form:

ln N! = N ln N - N

For large N, this is a good approximation to the factorial.

With some adjustments it is possible to make it better, but since it is mostly used for back-of-the-envelope types of calculations, this is usually good enough.

This is based on a truncation of Stirling's Series, an infinite series which converges to exactly the value of the factorial.