Maths Olympiad Prep

Track / Stage 6 / 307 of 400 #1307 of 1964

Problem 1307

National olympiad, first round
Number theory Difficulty 6.6 Find the answer

Compute the number of digits is 2015!2015!. Your score will be given by max{125(min{AC,CA}15),0}\max\{\lfloor125(\min\{\tfrac{A}{C},\tfrac{C}{A}\}-\tfrac{1}{5})\rfloor,0\}, where AA is your answer and CC is the actual answer.

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Official solution

To find the number of digits in 2015!2015!, we use the formula for the number of digits of a factorial, which is given by:

Number of digits of n!=log10(n!)+1 \text{Number of digits of } n! = \left\lfloor \log_{10}(n!) \right\rfloor + 1

Using Stirling's approximation for n!n!:

n!2πn(ne)n n! \approx \sqrt{2 \pi n} \left(\frac{n}{e}\right)^n

Taking the logarithm base 10 of both sides:

log10(n!)log10(2πn)+log10((ne)n) \log_{10}(n!) \approx \log_{10}(\sqrt{2 \pi n}) + \log_{10}\left(\left(\frac{n}{e}\right)^n\right)

log10(n!)log10(2πn)+nlog10(ne) \log_{10}(n!) \approx \log_{10}(\sqrt{2 \pi n}) + n \log_{10}\left(\frac{n}{e}\right)

log10(n!)12log10(2πn)+nlog10(n)nlog10(e) \log_{10}(n!) \approx \frac{1}{2} \log_{10}(2 \pi n) + n \log_{10}(n) - n \log_{10}(e)

log10(n!)12log10(2π)+12log10(n)+nlog10(n)nlog10(e) \log_{10}(n!) \approx \frac{1}{2} \log_{10}(2 \pi) + \frac{1}{2} \log_{10}(n) + n \log_{10}(n) - n \log_{10}(e)

For n=2015n = 2015:

log10(2015!)12log10(2π)+12log10(2015)+2015log10(2015)2015log10(e) \log_{10}(2015!) \approx \frac{1}{2} \log_{10}(2 \pi) + \frac{1}{2} \log_{10}(2015) + 2015 \log_{10}(2015) - 2015 \log_{10}(e)

Calculating each term separately:

12log10(2π)12log10(6.2832)12×0.7980.399 \frac{1}{2} \log_{10}(2 \pi) \approx \frac{1}{2} \log_{10}(6.2832) \approx \frac{1}{2} \times 0.798 \approx 0.399

12log10(2015)12×3.3041.652 \frac{1}{2} \log_{10}(2015) \approx \frac{1}{2} \times 3.304 \approx 1.652

2015log10(2015)2015×3.3046659.36 2015 \log_{10}(2015) \approx 2015 \times 3.304 \approx 6659.36

2015log10(e)2015×0.434874.51 2015 \log_{10}(e) \approx 2015 \times 0.434 \approx 874.51

Adding these together:

log10(2015!)0.399+1.652+6659.36874.515786.901 \log_{10}(2015!) \approx 0.399 + 1.652 + 6659.36 - 874.51 \approx 5786.901

The number of digits is:

5786.901+1=5786+1=5787 \left\lfloor 5786.901 \right\rfloor + 1 = 5786 + 1 = 5787

The final answer is 5787\boxed{5787}

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.