# First digit of 2020!

This is a follow up to First digit of 3^2020

Can you find the first digit of 2020! (factorial) without a computer?

I believe it's

3

Because

We know, that for sufficiently large $$n$$ we have $$n!\approx \sqrt{2\pi n}\ n^n/\exp n$$. Applying logarithm, we get $$\log n! \approx n\log n - n + \frac12 \log 2\pi n$$, or $$\log_{10} n! \approx n(\log n - 1)/\log 10+\frac12\log_{10} 2\pi n$$. For $$n=2020$$, we get $$\log_{10} 2020!\approx 5801.58667$$. Raising 10 to the power of mantissa (0.58667), we get about 3.861, so the first digit is 3.

Notice

Checking in Python (for example) does show that $$2020!$$ does indeed start with 3, but nevertheless, the $$n!\approx \sqrt{2\pi n}\ n^n/\exp n$$ approximate equality must be used with great care, since it says that it will hold for sufficiently large $$n$$, but in no way does it specify how large must $$n$$ be to achieve reasonable accuracy. Additionally, numbers may be very close but nevertheless start with different digits, when both are "close" to a digit multiplied by a power of 10 (e.g. 29999 and 30001 are within 0.007% of each other, but start with different digits, both being close to 30000).

• We can also use the Stirling given here to bound the error: en.wikipedia.org/wiki/… Apr 16 '20 at 6:23
• Ummm... how did you get $\log_{10} 2020 \approx 5799.53491$ "without a computer" (as demanded by the problem)? Apr 16 '20 at 6:27
• @im_so_meta_even_this_acronym Oh, thanks. Actually I forgot about the $\sqrt{2\pi n}$ factor, but fortunately it starts with a 1. Apr 16 '20 at 6:27
• @DavidG.Stork Well, it can be calculated either with a simple calculator (even with one which does only +-*/, because logarithms can be computed by summing series). Alternate way is to use a table of logarithms and calculate it by hand (since the numbers involved are not too large). Apr 16 '20 at 6:29
• @im_so_meta_even_this_acronym Thanks! I've updated my answer with account to $\sqrt{2\pi n}$ factor, it did not change significantly but became closer. Apr 16 '20 at 6:39

$$3$$

Because:

$$\ln 2020!=\sum_\limits{k=2}^{2020} \ln k \approx13358.65$$.

$$e^{13358.65}\approx 3.8724041499\times10^{5801}$$.

• @Glorfindel; Microsoft's for Windows 10: microsoft.com/en-us/p/windows-calculator/…
– JMP
Apr 16 '20 at 8:26
• Nice! The built-in calculator for Mac refuses to do it, and so does Google: google.com/search?client=firefox-b-d&q=exp+13358.65 Apr 16 '20 at 8:27
• I just noticed it also 'just' calculates 2020! without problems ... Apr 16 '20 at 10:28
• @Glorfindel; yeah, it's ok to 3248!.
– JMP
Apr 17 '20 at 2:59