[Math] the growth rate of the logarithm of the factorial sequence

computational complexityfactorial

I'd like to know the space complexity of storing bit string representations of the numbers in the factorial sequence (as in a memoized factorial function). So each number $f_i=i!$ in $i=0 \cdots n$ takes $\log_2 f_i$ bits, but how fast does that grow with $i$? Even better would be to know the sum of that sequence or (more reasonably) what a good bound is.

Best Answer

Note that $n! = \prod_{i=1}^{n} i \leq \prod_{i=1}^{n} n = n^{n}$. So $log(n!) \leq log(n^{n}) = n log(n)$. And so $log(n!) = O(n log(n))$.