Problem on my calculator

My calculator cannot handle numbers larger than 9.99999999 × 1 0 99 9.99999999\times10^{99} .

Find the largest n N n \in \mathbb{N} such that my calculator can handle n ! n!


The answer is 69.

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.

1 solution

Zach Abueg
Jul 30, 2017

9.99999999 × 1 0 99 n ! Assuming the calculator has 9 significant digits 1 0 100 > n ! Stirling’s formula 1 0 100 > 2 π n ( n e ) n Take the natural log of both sides 100 ln 10 > ln 2 π + ln n + n ln n n ln e 100 ln 10 ln 2 π > ( 1 2 + n ) ln n n 229.34 > ( 1 2 + n ) ln n n \displaystyle \begin{aligned} 9.99999999 \times 10^{99} & \geq n! & \small \color{#3D99F6} \text{Assuming the calculator has } \leq 9 \text{ significant digits} \\ 10^{100} & > n! & \small \color{#3D99F6} \text{Stirling's formula} \\ 10^{100} & > \sqrt{2 \pi n} \left( \frac ne \right) ^n & \small \color{#3D99F6} \text{Take the natural log of both sides} \\ 100 \ln 10 & > \ln \sqrt{2\pi} + \ln \sqrt{n} + n \ln n - n \ln e \\ 100 \ln 10 - \ln \sqrt{2\pi} & > \left(\frac 12 + n\right)\ln n - n \\ 229.34 & > \left(\frac 12 + n\right)\ln n - n \end{aligned}

The LHS now contains more manageable numbers, so we can do some checking with Kalpok's calculator (:

Note that e 4 < n < e 5 e^4 < n < e^5 :

n = e 4 ( 1 2 + e 4 ) 4 e 4 = 165.79 < 229.34 n = e 5 ( 1 2 + e 5 ) 5 e 5 = 596.15 > 229.34 \displaystyle n = e^4 \Longrightarrow \left(\frac 12 + e^4\right) \cdot 4 - e^4 = 165.79 < 229.34 \\ n = e^5 \Longrightarrow \left(\frac 12 + e^5\right) \cdot 5 - e^5 = 596.15 > \ 229.34

Clearly, n n must be closer to e 4 e^4 than to e 5 e^5 , so we make further approximations for n n . By testing some rational exponents of e e between 4 4 and 5 5 , we might find that e 4.25 = 70.1 e^{4.25} = 70.1 sets a very precise upper bound for n n :

n = e 4.25 ( 1 2 + e 4.25 ) 4.25 e 4.25 = 229.97 > 229.34 \displaystyle n = e^{4.25} \Longrightarrow \left(\frac 12 + e^{4.25}\right) \cdot 4.25 - e^{4.25} = 229.97 > 229.34

Since n n is an integer, we test the integers n 70 n \leq 70 :

n = 70 ( 1 2 + 70 ) ln 70 70 = 229.51 < 229.34 n = 69 ( 1 2 + 69 ) ln 69 69 = 225.27 < 229.34 \displaystyle \begin{aligned} n & = 70 \Longrightarrow \left(\frac 12 + 70\right) \ln 70 - 70 = 229.51 \ {\color{#D61F06}{\cancel{<}}} \ 229.34 \\ n & = 69 \Longrightarrow \left(\frac 12 + 69\right) \ln 69 - 69 = 225.27 \ {\color{#3D99F6}{<}} \ 229.34 \end{aligned}

Hence, n = 69 n = \boxed{69} .

-

An alternate solution would be to find the number of digits in n ! n! :

d ( n ! ) = log 10 n ! + 1 d(n!) = \big \lfloor \log_{10} n! \big \rfloor + 1

We see that n n must be quite large for n ! = 1 0 100 \lfloor{n!\rfloor} = 10^{100} , so ( n + 1 ) ! (n + 1)! must have more digits than n ! n! . Since d ( 1 0 100 ) = 101 d\left(10^{100}\right) = 101 and 1 0 100 10^{100} is the smallest number with 101 101 digits, we have

d ( n ! ) < 101 d ( ( n + 1 ) ! ) (1) \displaystyle \begin{aligned} d(n!) < 101 \leq d\bigg((n + 1)!\bigg) \tag{1} \end{aligned}

Stirling's formula says that for any positive integer n n , we have the bounds 2 π n n + 1 / 2 e n n ! e n n + 1 / 2 e n \sqrt{2\pi}\ n^{n+1/2}e^{-n} \le n! \le e\ n^{n+1/2}e^{-n}

so for log 10 n ! + 1 \left \lfloor \log_{10} n! \right \rfloor + 1 ,

log 10 2 π + ( n + 1 2 ) log 10 n n log 10 e + 1 log 10 n ! + 1 log 10 e + ( n + 1 2 ) log 10 n n log 10 e + 1 \Bigg \lfloor \log_{10} \sqrt{2\pi} + \left(n + \frac 12\right) \log_{10} n - n \log_{10} e \Bigg \rfloor + 1 \ \leq \ \big \lfloor \log_{10} n! \big \rfloor + 1 \ \leq \ \Bigg \lfloor \log_{10} e + \left(n + \frac 12\right) \log_{10} n - n \log_{10} e \Bigg \rfloor + 1

Combining this result with our previous inequality, ( 1 ) (1) , and doing some checking, we find that 69 ! 69! has 99 < 101 99 < 101 digits and 70 ! 70! has 101 101 101 \leq 101 digits.

Hence, n = 69 n = \boxed{69} .

I can't understand how is this a level 2 question...

Shubham Vermani - 3 years, 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...