# Finding $n,m\in N$ such that $|\sqrt{e} - \frac{n}{m}| < \frac{1}{100}$

Find $$n,m\in N$$ such that $$|\sqrt{e} - \frac{n}{m}| < \frac{1}{100}$$.
I wrote this proof:

Let $$f(x)=e^x=\sum_{n=0}^\infty \frac{x^n}{n!}$$
$$|\sqrt{e}-P_N(\frac{1}{2})|=|R_N(\frac{1}{2})| < \frac{1}{100}$$

From the Taylor theorem we get that there exists $$0 such that:
$$|R_N(\frac{1}{2})| = |\frac{f^{(N+1)}(c)}{(N+1)!2^N}| = \frac{e^c}{(N+1)!2^N} \leq \frac{e}{(N+1)!2^N}\leq \frac{3}{(N+1)!2^N}\leq \frac{3}{(N+1)!}<10^{-2}$$

hence for $$N=5$$ we get $$720>300$$ and the inequality holds.
Therefore:

$$P_5(\frac{1}{2})=1+\frac{1}{2}+\frac{1}{8}+\frac{1}{6\cdot8}+\frac{1}{16\cdot 24}+\frac{1}{32\cdot 120} = \frac{32\cdot120+16\cdot 120+4\cdot 120+4\cdot 20+2\cdot 5}{32\cdot 120} = \frac{n}{m}$$

Did I get it right? Was there a simpler method?

Yes, there is a simpler method using CF (Continued Fractions). Do you happen to know them ? Here is the result (explanations just after). $$\underbrace{\frac{28}{17}}_{\approx \ 1.6471} < \underbrace{\sqrt{e}}_{\approx \ 1.6487} < \underbrace{\frac{33}{20}}_{= \ 1.65}$$

Explanations : A continued fraction is an expression of the form:

$$a=a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cfrac{1}{a_4+\cfrac{1}{a_5+\cfrac{1}{a_6+\cdots}}}}}}$$

Here, we rely on this formula:

$$e^{1/2}=1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{5+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{9+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{13+\cfrac{1}{1+\cfrac{1}{1+\cdots}}}}}}}}}}}}$$

(recalled for example in this answer to a question where you will find other things about $$\sqrt{e}$$) with (excepted for the first two $$a_k$$) a periodicity with $$a_k=1$$, but for terms $$a_{3k+4}=4k+5$$...

It is not the place here to recall the theory of continued fractions. It suffices to say that we work with convergents, the $$n$$th convergent being the rational number obtained by stopping at the $$n$$th level, erasing everything situated to the right and the bottom of $$a_n$$ ; here are the first convergents in our case :

$$c_0=1,\ c_1=1+\cfrac{1}{1}=2, \ c_2=1+\cfrac{1}{1+\cfrac{1}{1}}=\frac32,$$

$$c_3=1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1}}}=\frac53,\ c_4=1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{5}}}}=\frac{28}{17},...$$

It is known that it is among these convergents that one can find the closest rational approximations of the given real number. Moreover, you may have observed that the sequence $$c_n$$ is alternated around its limit here $$\sqrt{e}$$ (at one time below, at next time above, etc.). Therefore, we can achieve closer and closer "bracketings" of $$\sqrt{e}$$ by rational approximations.

Remark: all $$e^{\frac{1}{n}}, \ n>1$$ have the same kind of continued fractions: see here.

• I have attempted to be more precise in my answer. Any comment ? Jun 13 at 15:00
– Lilo
Jun 13 at 23:12

Your solution is correct, but unnecessarily complicated. Also, there seems to be an error in your expression for $$\left\lvert{R_N\left(\tfrac12\right)}\right\rvert,$$ which doesn't invalidate your numerical answer, but adds to the complication of finding it.

You're using Taylor's theorem with the Lagrange form of the remainder. Surely the expression should be: $$\left\lvert{R_N\left(\frac12\right)}\right\rvert = \left\lvert{\frac{f^{(N+1)}(c)}{(N+1)!\cdot2^{N+1}}}\right\rvert$$ Having $$2^{N+1}$$ rather than $$2^N$$ in the denominator makes things slightly easier. Also, you have gone rather too far in your simplifying approximations; the approach is valid, but the calculation is harder than it needs to be.

Continuing in a simpler way, using the fact that $$e < 4,$$ so $$\sqrt{e} < 2$$: $$\frac{e^c}{(N+1)!\cdot2^{N+1}} < \frac{\sqrt{e}}{(N+1)!\cdot2^{N+1}} < \frac{1}{(N+1)!\cdot2^N}.$$

Therefore, all we need is to find $$N$$ large enough that: $$(N+1)!\cdot2^N > 100.$$ So we don't need $$N = 5$$; it is good enough to take $$N = 3.$$ Then we find: $$\sqrt{e} - \frac{79}{48} < \frac{1}{192}.$$

We could get the same value for $$\tfrac{n}{m}$$ even more simply, without using the remainder expression for Taylor's theorem - it's quite easy to get it wrong, and I'm not sure I haven't! - instead just using the infinite series for $$\sqrt{e}$$: \begin{align*} \sqrt{e} & = 1 + \frac12 + \frac18 + \frac1{48} + \frac1{384}\left(1 + \frac1{5\cdot2} + \frac1{5\cdot6\cdot2^2} + \cdots\right) \\ & < \frac{79}{48} + \frac1{384}\left(1 + \frac1{2} + \frac1{2^2} + \cdots\right) \\ & = \frac{79}{48} + \frac1{192}, \end{align*} an approximation which is still more than good enough $$\ldots$$ indeed, the accuracy is just the same! (I miscalculated at first.) I presume this is just a coincidence.

(Continued fraction methods, as used in the two previous answers, give more accurate approximations than these - in fact, the most accurate approximations possible - but we don't need that level of precision for this question.)

You can just compute the continued fraction getting $$[1;1,1,1,5,1,1,9,1,1,13,\ldots]$$. If you stop after the $$5$$ this evaluates to $$\frac {28}{17}$$, which is off by less than $$0.0017$$
• $23/14$ also works and is simpler.
• @lhf: I tried stopping before the $5$ and got $/frac 53$, which isn't good enough. Usually stopping just before a big number means you are very close, but $5$ isn't so big. You are right that is good enough. Jun 13 at 14:21