Number of digits in n!

Problem : Find Number of Digits in n!

Solution: Before that let’s see how to find number of digits in a Number ‘n’

Image

So, numdigits(n!) = log(n!)= log1 + log2 + log3 ………………………..log n

To find numdigits(n!) above direct formula can be used

or

there is one other formula for this

numDigits(n!) = floor(   (  ln(2*pi*n)/2 + n*( ln(n)-1)  )/ln(10)   )+1

 

Posted in Uncategorized | Tagged | Leave a comment