Determine the number of digits of 1 0 , 0 0 0 , 0 0 0 ! .
Details and Assumptions
It is 10 million factorial.
You may use the following approximation:
lo
g
1
0
2
=
0
.
3
0
1
0
2
9
9
9
5
6
6
3
9
8
…
lo
g
1
0
π
=
0
.
4
9
7
1
4
9
8
7
2
6
9
4
1
3
…
lo
g
1
0
e
=
0
.
4
3
4
2
9
4
4
8
1
9
0
3
2
5
…
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Sir, any simple proof for Stirling Apporoximation please ?
Great solution, I came upon this approximation but couldn't solve it. Just a question. Isn't ⌊ lo g n ! ⌋ + 1 = to ⌈ lo g n ! ⌉ ?
Not true for n = 0 , 1 . But it works for n = 2 , 3 , … because n ! is not a perfect power of 1 0 .
At first I tried to approximate the given factorial into an integral after taking logarithm (since 1 0 7 is very large). But I was off by 4 , since the approximation wasn't good enough. So I kind of cheated and got the answer using a C++ code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Is there any other way to do this other than the solutions already mentioned here?
Problem Loading...
Note Loading...
Set Loading...
We can use Stirling's Approximation: 2 π n ( e n ) n ≤ n ! ≤ e n ( e n ) n Now take the log (base 10) of all these expressions: 2 1 lo g ( 2 π ) + 2 1 lo g n + n ( lo g n − lo g e ) ≤ lo g n ! ≤ lo g e + 2 1 lo g n + n ( lo g n − lo g e ) Now if we substitute n = 1 0 7 and the values given, we get the following: 6 5 6 7 0 5 9 . 0 8 ≤ lo g n ! ≤ 6 5 6 7 0 5 9 . 1 2 6 5 6 7 0 6 0 ≤ ⌊ lo g n ! ⌋ + 1 ≤ 6 5 6 7 0 6 0 Now the formula for the number of digits in n ! is exactly ⌊ lo g n ! ⌋ + 1 . Therefore, the number of digits in 1 0 7 ! is 6 5 6 7 0 6 0 .