# How to obtain the number of digits in n!?

How to obtain the number of digits in $n!$ ?

My approach :

I Used Stirling's formula to find out the approximate value of $n!$

Let the approximate value be $S$

Thus, number of digits in $\ = \left \lfloor \log S \right \rfloor$ + 1

where $\left \lfloor . \right \rfloor$ is floor function.

-
–  lhf Jun 29 '12 at 12:07

## 2 Answers

The question came up here on MathOverflow.

-
Great! What a coincidence! –  Bazinga Jun 29 '12 at 12:28

Number of digits in $n!=1+$ $\left \lfloor \log(n!) \right \rfloor$. Now $\log(n!)=\log(1)+\log(2)+...+\log(n)$. Therefore, Number of digits in $n!=$ $1+ \left \lfloor \sum_{1}^{n}\log(k) \right \rfloor$.

-