Factorials exhibit an interesting trait. The minimum value needed for the length of x! to reach nx, where n is a positive integer, forms an interesting sequence. Let len(x!) = int(log(x!))+1 to account for the extra digit.
What is the relationship between len(x!) and x?
What is the smallest number such that the len(x!)>=8x?
How can I approximate when len(x!) first exceeds/equals nx?
Stirling's approximation ln(n!) 「 n*ln(n)n gives a good approximation of n! for large values of n (and Charlie showed they do get large)
So let's use x = 10^n*e
ln((10^n*e)!) 「 (10^n*e)ln(10^n*e)  10^n*e
ln((10^n*e)!) 「 (10^n*e)(ln(10^n)+ln(e))  10^n*e
ln((10^n*e)!) 「 (n*10^n*e*ln10 + 10^n*e*1)  10^n*e
ln((10^n*e)!) 「 n*10^n*e*ln10
ln((10^n*e)!) 「 n*10^n*e/log(e)
log((10^n*e)!) 「 n*10^n*e
Substitute back so see we got what we wanted
log(x!) 「 n*10^n*e =nx
int(log(x!)+1 「 int(n*10^n*e)+1 「 int(n*10^n*e)
The left side is len(x!) and the right is what Charlie already observed: e multiplied by 10^n rounded off.

Posted by Jer
on 20060302 12:48:08 