Writing continued fractions of irrational numbers as infinite series

4.5k Views Asked by At

Infinite sums have been formulated for famous irrational numbers, such as $\pi, \phi,e,\sqrt2$ and a few others that can be listed here and here:


Here are some examples: (There are more examples if you follow the links above)

$$\sqrt 2 = \sum_{k=0}^\infty{\frac{(2k+1)!}{2^{3k+1} (k!)^2}}$$ $$\pi = \sum_{k=0}^\infty{\frac{(2^{k+1})(k!)^2}{2k+1}}$$ $$\phi = \frac{13}{8} + \sum_{k=0}^\infty{\frac{((-1)^{k+1})(2k+1)!}{((k+2)!)(k!)(4^{2k+3})}}$$ $$e = \sum_{k=0}^\infty{\frac{1}{k!}}$$


In the section that follows I will just be discussing non-transcendental numbers (such as $\sqrt2,\sqrt3,\sqrt5$, etc (not $\pi,e$, etc)

As far as I know there are no known infinite sums for $\sqrt3,\sqrt5$ and irrational numbers such which can be written as $\sqrt[a]b$ Where $a$ is an real number > 0, and b is a prime number or the product of prime numbers. And such that $\sqrt[a]b$ is not an integer (perfect squares or perfect cubes).

However, there are continued fractions which can represent some of these numbers, such as $\sqrt5$:

$$\sqrt5 = 2+ \frac{1}{4 + \frac{1}{4 + \frac{1}{4 + \frac{1}{4 + \frac{1}{4 + \frac{1}{4 + ...}}}}}}$$

This wikipedia section discusses this concept nicely: Click here


SO MY QUESTION IS:

If there is a continued fraction for $\sqrt x$, then how do we go from the continued fraction to an infinite sum? (Conversion maybe?) Let's take $\sqrt5$ as an example:


How I thought of doing this, would to work out rational approximations by taking the continued fraction to certain terms (T), such as:

  • T1 = $2 = \frac{2}{1}$
  • T2 = $2+ \frac{1}{4} = \frac{9}{4} = 2,25$
  • T3 = $2+ \frac{1}{4 + \frac{1}{4}} = \frac{38}{17} = 2,234294118...$
  • T4 = $2+ \frac{1}{4 + \frac{1}{4+\frac{1}{4}}} = \frac{161}{72} = 2,236111111...$
  • T5 = $2+ \frac{1}{4 + \frac{1}{4+\frac{1}{4+\frac{1}{4}}}} = \frac{682}{305} = 2,236065574...$

  • T(n) = $\frac{T_{n+1}(OEIS: A001077)}{T_{n+1}(OEIS: A001076)}$

and the list goes on (if we did this "infinitely" many times we should theoretically reach $\sqrt5$ and that is what we are looking for :)

Then what I tried to do is take these rational approximations and finding the difference between them, so we could then write it as an infinite sum, comprising of adding the differences (D) of these rational approximations.

  • $D1 = T2-T1 = \frac{9}{4} - 2 = \frac{1}{4}$
  • $D2 = T3-T2 = \frac{38}{17} - \frac{9}{4} = -\frac{1}{68}$
  • $D3 = T4-T3 = \frac{161}{72} - \frac{38}{17} = \frac{1}{1224}$
  • $D4 = T5-T4 = \frac{682}{305} - \frac{161}{72} = -\frac{1}{21960}$

The numerator stays 1 and the denominators continue in the following sequence: https://oeis.org/A156084 (Each time the term alternates between being positive and negative). Let's call the absolute value of each term in the sequence $a_k$, $(a_1 = \frac{1}{4},a_2 = \frac{1}{68})$; then$\sqrt5$ could be written as:

$$\sqrt5 = 2 + \sum_{k=0}^\infty{(-1)^k} . {a_{k+1}} = 2 + \frac{1}{4} - \frac{1}{68} + \frac{1}{1224} - \frac{1}{21960} ...$$


Kind Regards

Joshua

5

There are 5 best solutions below

1
On

Your line of thinking is right:

In general, any convergent sequence can be converted into a series whose sum has the same limit: if $a_n$ is a sequence that converges to $a$ as $n$ tends to infinity, put $b_0 = a_0, b_1 = a_1 - a_0, \ldots, b_{i+1} = a_{i+1} - a_i, \ldots$; then $a_n = \sum_{i=0}^n b_n$ and the $b_n$ comprise a convergent series whose sum is $a$.

So given a number $a$ that can be represented as a continued fraction, if you take the $a_n$ to be the the partial convergents of the continued fraction, you can find a series whose sum is $a$. ("Partial convergent" is the jargon for truncating a continued fraction after a finite number of divisions, see https://en.wikipedia.org/wiki/Continued_fraction#Continued_fraction_expansions_of_.CF.80).

2
On

There is at least one formula to convert any series to a continued fraction provided none of the terms in the series is zero; see this page from NIST. But you already have a continued fraction and you're trying to go in the opposite direction (to find the formula for an equal series).

There are also formulas to convert some continued fractions to series, for example in this paper.

I don't know of a general formula that applies to your examples, but I notice that if $a_1 = 0$, $a_2 = 1$, and $a_n = 4a_{n-1} + a_{n-2}$ for $n \geq 3$, then $T_1 - 2 = \frac{a_1}{a_2}$, and in general, for $n \geq 1$, $$ \frac{a_{n+1}}{a_{n+2}} = \frac{a_{n+1}}{4a_{n+1} + a_n} = \frac{1}{4 + \frac{a_n}{a_{n+1}}} $$ So if we set $T_n = 2 + \frac{a_n}{a_{n+1}}$ then in general $$ T_{n+1} - 2 = \frac{1}{4+(T_n - 2)}, $$ which is the recursion exhibited by your continued fraction for $\sqrt5$.

A closed-form formula for $a_n$ (eliminating the recursion) is $$ a_n = \frac{(2+\sqrt5)^{n-1} - (2-\sqrt5)^{n-1}}{2\sqrt5} = \frac{\phi^{3(n-1)} - (-\phi)^{-3(n-1)}}{2\sqrt5} $$ where $\phi$ is the golden ratio, $\frac12(1+\sqrt5)$.

As you observed, the finite expansions of the continued fraction are equal to the partial sums of a series whose general term is $T_{n+1}-T_n$. Substituting the closed forms of $a_n$, $a_{n+1}$, and $a_{n+2}$ and simplifying, we get \begin{align} T_{n+1}-T_n &= \frac{a_{n+1}}{a_{n+2}} - \frac{a_n}{a_{n+1}} = \frac{a_{n+1}^2 - a_{n+2} a_n}{a_{n+2} a_{n+1}} \\ &= \frac{(-1)^{n+1}}{a_{n+2} a_{n+1}} \\ &= \frac{(-1)^{n+1}}{\phi^{6n+9} + (-\phi)^{-6n-9} + 4(-1)^n} \\ &= \frac{(-1)^{n+1}}{(2+\sqrt5)^{2n+3} + (2-\sqrt5)^{-2n-3} + 4(-1)^n}. \end{align}

This might seem a little disappointing at first because the closed form of the general term for your sequence for $\sqrt5$ involves $\sqrt5$ itself, but if you expand each term symbolically (treating $\sqrt5$ as a symbol, not substituting a decimal approximation), the odd powers of $\sqrt5$ cancel out and you're left with just rational numbers. Still, it might be easier after all to just use the recursive formula for $a_n$ to generate each successive term $T_{n+1}-T_n$.


By the way, you can also obtain a series for $\sqrt5$ by considering $\sqrt5 = 2\left(1+\frac14\right)^{1/2}$ and using the binomial theorem to expand \begin{align} \left(1+\frac14\right)^{1/2} &= 1 + \frac12\cdot\frac14 + \frac{1}{2!}\cdot\frac12\left(-\frac12\right)\left(\frac14\right)^2 + \frac{1}{3!}\cdot\frac12\left(-\frac12\right) \left(-\frac32\right)\left(\frac14\right)^3 + \cdots \\ &= 1 + \frac18 + \sum_{k=0}^\infty \frac{(-1)^{k+1}(2k+1)!!}{8^{k+2}(k+2)!}\\ &= 1 + \frac18 - \frac{1}{128} + \frac{1}{1024} - \frac{5}{32768} + \frac{7}{262144} - \frac{21}{4194304} + - \cdots \end{align} where $(2k+1)!!$ is the double factorial $(2k+1)!! = (2k+1)(2k-1)\cdots5\cdot3\cdot1$, but this converges a lot slower than your continued fraction.

16
On

You can use the convergents to the continued fraction to obtain series, since the convergents give close rational approximations to $5$. $\def\lfrac#1#2{{\large\frac{#1}{#2}}}$

Using $\sqrt{5} \approx \lfrac{9}{4}$ we get:

$\sqrt{5} = \lfrac94 ( 1 - \lfrac1{9^2} )^\lfrac12 = \lfrac{9}{4} \sum_{k=0}^\infty \binom{1/2}{k} \lfrac{(-1)^k}{9^{2k}} = \lfrac{9}{4} - \lfrac{9}{4} \sum_{k=1}^\infty \lfrac{2 \cdot (2k-2)!}{k! \cdot (k-1)! \cdot 18^{2k}}$.

Using $\sqrt{5} \approx \frac{38}{17}$ we get:

$\sqrt{5} = \lfrac{38}{17} ( 1 + \lfrac1{38^2} )^\lfrac12 = \lfrac{38}{17} \sum_{k=0}^\infty \binom{1/2}{k} \lfrac{1}{38^{2k}} = \lfrac{38}{17} - \lfrac{38}{17} \sum_{k=1}^\infty \lfrac{(-1)^k \cdot 2 \cdot (2k-2)!}{k! \cdot (k-1)! \cdot 76^{2k}}$.

0
On

We might think and use one of the many approximation methods to find the (real) root of a function. For instance if we take $y = x^{\,2} - p$ with $p$ any real number, and adopt the simple secant method, starting with an over-estimate $x_q$ of of $\sqrt p$, we get $$ \frac{{x_{n + 1} - x_q }} {{x_n - x_q }} = \frac{{ - y_q }} {{y_n - y_q }} = - \frac{{x_q ^{\,2} - p}} {{x_n ^{\,2} - x_q ^{\,2} }} $$ i.e. $$ x_{n + 1} = x_q - \frac{{x_q ^{\,2} - p}} {{x_n + x_q }}\quad \left| {\;x_0 = 0} \right. $$ and for the delta $$ x_{n + 1} - x_n = x_q - x_n - \frac{{x_q ^{\,2} - p}} {{x_n + x_q }} = - \frac{{x_n ^{\,2} - p}} {{x_n + x_q }} $$ Yet, unfortunately, this is not easily tranformable in a recurrence that involves only the deltas and not their partial sums.

0
On

I wish to show you some of my favorite expansion of the golden ratio, and other things you can do with it. It isn't necessarily a series, and the first is neither an algorithm or continued fraction.

We have

$$\phi=\sqrt{1+\sqrt{1+\sqrt{1+\dots}}}$$

You can see the truth in this simply because $\phi=\sqrt{1+\phi}$ is a true statement, both by the above form, and by calculating $\phi$ out, or any other ways.

In a similar manner, we have

$$\sqrt5=2\phi-1=-1+2\sqrt{1+\sqrt{1+\sqrt{1+\dots}}}$$

Albeit somewhat cheatery, but its a true statement.

We also have

$$\phi=\lim_{n\to\infty}\frac{F(n)}{F(n-1)}$$

where $F(n)$ is the $n$th Fibonacci number. It converges rather quickly too.

With a modified Fibonacci sequence, we can get similar interesting things.

Allow $F_a(n)$ be the $n$th modified Fibonacci number, where

$$F_a(n)=F_a(n-1)+aF_a(n-2)$$

and $F_a(1)=F_a(2)=1$.

That small modification results in

$$\lim_{n\to\infty}\frac{F_a(n)}{F_a(n-1)}=\frac{1+\sqrt{1+4a}}{2}$$

$$\sqrt{a}=-1/2+\lim_{n\to\infty}\frac{F_{a-1/4}(n)}{F_{a-1/4}(n-1)}$$

(I'm pretty sure I calculated the limit correctly, but if someone could check my work, that'd be great)