TITLE: Evaluation of a continued fraction
QUESTION [23 upvotes]: Puzzle question... I know how to solve it, and will post my solution if needed; but those who wish may participate in the spirit of coming up with elegant solutions rather than trying to teach me how to solve it. [paraphrased from Lone Learner]   

Prove (or disprove) the following equality:
  $$1+\cfrac1{1+\cfrac2{1+\cfrac3{1+\ddots}}}=\frac1{\displaystyle e^{1/2}\sqrt{\frac{\pi}{2}}\;\mathrm{erfc}\left(\frac1{\sqrt2}\right)}\approx 1.525135276\cdots$$

(taken from Closed form for a pair of continued fractions)

REPLY [8 votes]: Let
\begin{align*}
 p_n &= p_{n-1}+np_{n-2}, \quad p_{-1} = 1, \quad p_0=1,
 \\
 q_n &= q_{n-1}+nq_{n-2}, \quad q_{-1} = 0, \quad q_0=1,
 \\
 r_n &= \frac{p_n}{q_n}.
\end{align*}
So the $r_n$ are the convergents of the continued fraction:
$$
 r_0 = 1,\qquad
 r_1 = 1+\cfrac{1}{1},\qquad
 r_2 = 1+\cfrac{1}{1+\cfrac{2}{1}},\qquad
 r_3 = 1+\cfrac{1}{1+\cfrac{2}{1+\cfrac{3}{1}}},
$$
and so on.  Consider the exponential generating functions
$$
 F(x) = \sum_{n=0}^\infty \frac{p_{n-1}}{n!}\,x^n,\qquad
 G(x) = \sum_{n=0}^\infty \frac{q_{n-1}}{n!}\,x^n .
$$
They are solutions of the differential equations
\begin{align*}
 &F'(x) + (-1-x)F(x) = 0,\quad F(0)=1,
 \\
 &G'(x) + (-1-x)G(x) = 1,\quad G(0)=0 .
\end{align*}
A solution for the homogeneous equation $y'+(-1-x)y=0$ is
$$
 F_1(x) = e^{(1+x)^2/2}
$$
and a particular solution for the inhomogeneous equation
$y'+(-1-x)y=1$ is
$$
 F_2(x) = \sqrt{\frac{\pi}{2}}\,e^{(1+x)^2/2}\,
 \mathrm{erf}\,\frac{x+1}{\sqrt{2}}
$$
After all, there are formulas for the solution of first-order
linear differential equations.
Hayman's method (Wilf, generatingfunctionology, Theorem 4.5.1) 
shows that the coefficients of $F_1$ are asymptotic to
$$
 \frac{e^{n/2+\sqrt{n}+1/4}}{2n^{(n+1)/2}\sqrt{\pi}}
$$
as $n \to \infty$ and the coefficients of $F_2$ are asymptotic to
$$
 \frac{e^{n/2+\sqrt{n}+1/4}}{2\sqrt{2}n^{(n+1)/2}}
$$
Applying the initial conditions, we conclude that
$$
 F(x) = e^{-1/2}F_1(x),\qquad
 G(x) = F_2(x)-\sqrt{\frac{\pi}{2}}\,\mathrm{erf}\,\frac{1}{\sqrt{2}}
 \,F_1(x)
$$
So
\begin{align*}
\frac{p_{n-1}}{n!} &\sim \frac{e^{n/2+\sqrt{n}-1/4}}{2n^{(n+1)/2}\sqrt{\pi}};
\\
\frac{q_{n-1}}{n!} &\sim
\frac{e^{n/2+\sqrt{n}+1/4}}
 {2\sqrt{2}n^{(n+1)/2}} -
 \frac{e^{n/2+\sqrt{n}+1/4}\sqrt{\pi}\text{erf}(1/\sqrt{2})}
 {2\sqrt{2}n^{(n+1)/2}\sqrt{\pi}} = 
 \frac{e^{n/2+\sqrt{n}-1/4}e^{1/2}\text{erfc}(1/\sqrt{2})}
 {2\sqrt{2}n^{(n+1)/2}}
\end{align*}
with $\text{erfc}(x)=1-\text{erf}(x)$.
Finally,
$$
 \frac{p_{n-1}}{q_{n-1}} \sim
 \frac{1}{\displaystyle
 e^{1/2}\;\sqrt{\frac{\pi}{2}}\;\text{erfc}\,\frac{1}{\sqrt{2}}}
 \approx 1.525135276
$$
so that is the value of the continued fraction.