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)

  • 10
    $\begingroup$ This is recreational? :D $\endgroup$ Apr 4 '13 at 17:42
  • 10
    $\begingroup$ More fun than a barrel of monkeys. $\endgroup$
    – GEdgar
    Apr 4 '13 at 17:45
  • 18
    $\begingroup$ Erfc. I’ll take the monkeys, please. $\endgroup$ Apr 4 '13 at 18:50
  • 6
    $\begingroup$ Maybe enjoying this sort of thing is the defining characteristic of analysts. (I'm not an analyst.) $\endgroup$ Apr 21 '13 at 21:00
  • 2
    $\begingroup$ Say you got the problem as in math.stackexchange.com/questions/69519 without a formula for the value. How would you find it? $\endgroup$
    – GEdgar
    Apr 23 '13 at 18:44

The iterated integral of the complementary error function,

$$\begin{align*} \mathrm{i}^n\mathrm{erfc}(z)&=\underbrace{\int_z^\infty\int_{t_{n-1}}^\infty\cdots\int_{t_1}^\infty}_{n} \mathrm{erfc}(t)\,\mathrm dt\cdots\mathrm dt_{n-2}\mathrm dt_{n-1}\\ &=\frac2{n!\sqrt\pi}\int_z^\infty(t-z)^n\exp(-t^2)\,\mathrm dt \end{align*}$$

(see e.g. Abramowitz and Stegun) satisfies the difference equation


with initial conditions $\mathrm{i}^0\mathrm{erfc}(z)=\mathrm{erfc}(z)$ and $\mathrm{i}^{-1}\mathrm{erfc}(z)=\dfrac2{\sqrt\pi}\exp(-z^2)$.

This recurrence can be rearranged:


Iterating this transformation yields the continued fraction


(As a note, it can be shown that $\mathrm{i}^n\mathrm{erfc}(z)$ is the minimal solution (that is, $\mathrm{i}^n\mathrm{erfc}(z)$ decays as $n$ increases) of its difference equation; thus, by Pincherle, the CF given above is correct.)

In particular, the case $n=0$ gives


If $z=\dfrac1{\sqrt 2}$, then

$$\frac{\sqrt{e\pi}}{2}\mathrm{erfc}\left(\frac1{\sqrt 2}\right)=\cfrac1{\sqrt 2+\cfrac2{\sqrt 2+\cfrac4{\sqrt 2+\cfrac6{\sqrt 2+\dots}}}}$$

We now perform an equivalence transformation. Recall that a general equivalence transformation of a CF


with some sequence $\mu_k, k>0$ looks like this:

$$b_0+\cfrac{\mu_1 a_1}{\mu_1 b_1+\cfrac{\mu_1 \mu_2 a_2}{\mu_2 b_2+\cfrac{\mu_2 \mu_3 a_3}{\mu_3 b_3+\cdots}}}$$

You can easily show that an equivalence transformation leaves the value of the CF unchanged.

If we apply this to the CF earlier with $\mu_k=\dfrac1{\sqrt 2}$, then

$$\sqrt{\frac{e\pi}{2}}\mathrm{erfc}\left(\frac1{\sqrt 2}\right)=\cfrac1{1+\cfrac1{1+\cfrac2{1+\cfrac3{1+\dots}}}}$$

The CF in the OP is now easily obtained from this.

  • 4
    $\begingroup$ +1 milliramanujan (Gosper frequently ranked his exotic formulas in milliramanujan units). Too bad we don't have multidimensional votes. $\endgroup$
    – Math Gems
    Apr 4 '13 at 20:06
  • $\begingroup$ @MathGems, J.M. gets one from me too. $\endgroup$
    – vonbrand
    Apr 4 '13 at 20:07
  • $\begingroup$ So, was my mention of erfc needed for you to get the solution? $\endgroup$
    – GEdgar
    Apr 4 '13 at 21:19
  • $\begingroup$ @GEdgar: (*embarrassed*) ...yes. :) I had forgotten all about that thread, actually, until you brought it up. $\endgroup$ Apr 5 '13 at 0:08

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.

  • $\begingroup$ By "the coefficients of $F_1$", do you mean its Maclaurin series coefficients? $\endgroup$ Apr 25 '13 at 17:42
  • 1
    $\begingroup$ Yes, Maclaurin. $\endgroup$
    – GEdgar
    Apr 25 '13 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.