# Prove that this sequence of continued fractions $\frac{2}{1}, \frac{6}{5+\frac{4}{3}}, \frac{12}{11+\frac{10}{9+\frac{8}{7}}},\dots$ tends to $1$.

## The Problem:

I'll write up a couple more terms:

$$\frac{2}{1}, \frac{6}{5+\frac{4}{3}}, \frac{12}{11+\frac{10}{9+\frac{8}{7}}}, \frac{20}{19+\frac{18}{17+\frac{16}{15+\frac{14}{13}}}}, \frac{30}{29+\cfrac{28}{27+\frac{26}{25+\frac{24}{23+\frac{22}{21}}}}},\dotsc$$

This sequence does have a closed form (where $$s_0 = \frac{2}{1}, s_1 = \frac{6}{5+\frac{4}{3}}, \dots$$,) however, it's not the nicest of closed forms and as far as I know it can only be expressed using matrix multiplication:

Let

$$m_n = \begin{bmatrix}0 & 1\end{bmatrix}\left(\prod_{k=\frac{n(n+1)}{2}}^{\frac{(n+1)(n+2)}{2}-1}\begin{bmatrix}0 & 1 \\ 2(k+1) & 2k+1\end{bmatrix}\right)$$

Then

$$s_n = \frac{m_n\begin{bmatrix}1 \\ 0\end{bmatrix}}{m_n\begin{bmatrix}0 \\ 1\end{bmatrix}} = \frac{{m_n}_1}{{m_n}_2}$$

An important note is that in the product we put new terms to the right in the matrix multipication, otherwise we get a different result.

To see that this is true, here is my previous question where I tried to find the closed form of such continued fractions.

So the question is: $$\lim_{n \to \infty} s_n \stackrel{?}{=} 1$$

## My attempt:

I calculated the first 10 terms in Python with $$2$$ methods. First I used the matrix multiplication method:

import math
import numpy as np

def term(n):
k_from = int((n*(n+1))/2)
k_to = int(((n+1)*(n+2)/2)-1)

cur_matrix = [[1,0],[0,1]]

for k in range(k_from,k_to+1):
cur_matrix = np.dot(cur_matrix,[[0,1],[2*(k+1),2*k+1]])

a = cur_matrix[1][0]
b = cur_matrix[1][1]

return (a, b, a/b)

for n in range(10):
a, b, v = term(n)
print("n = " + str(n) + " | value = " + str(a) +"/" + str(b) + " = " + str(v))


Its output was:

n = 0 | value = 2/1 = 2.0
n = 1 | value = 18/19 = 0.9473684210526315
n = 2 | value = 852/851 = 1.00117508813161
n = 3 | value = 75220/75221 = 0.9999867058401244
n = 4 | value = 11028390/11028389 = 1.000000090675075
n = 5 | value = -1870386298/-1870386297 = 1.000000000534649
n = 6 | value = -466916824/-466916825 = 0.999999997858291
n = 7 | value = 670228008/670228009 = 0.9999999985079704
n = 8 | value = -1626586486/-1626586487 = 0.9999999993852156
n = 9 | value = 1994715754/1994715755 = 0.9999999994986755


I noticed the negative values in the expressions, and first I didn't know how they could have gotten there. But as it turns out the values of the numerator and the denominator get so huge so fast, that it easily flows over the $$2^{32}$$ integer limit, so numbers roll over into the negatives.

So I tried the original method of calculating the continued fractions as they are:

def termfrac(n):

if(n == 0):
return 2.0

else:
value = 1 + n*(n+1)
nextnum = value + 1

for i in range(n):
value = (nextnum+1) + (nextnum)/value
nextnum += 2
value = nextnum/value

return value

for n in range(10):
v = termfrac(n)
print("n = " + str(n) + " | value = " + str(v))


This time I got the output of:

n = 0 | value = 2.0
n = 1 | value = 0.9473684210526316
n = 2 | value = 1.00117508813161
n = 3 | value = 0.9999867058401245
n = 4 | value = 1.000000090675075
n = 5 | value = 0.9999999995875577
n = 6 | value = 1.000000000001339
n = 7 | value = 0.9999999999999969
n = 8 | value = 1.0
n = 9 | value = 1.0


As you can see terms for $$n=8$$ and $$n=9$$ are so close to $$1$$, that they get rounded to $$1$$. I checked the first $$3$$ terms with my calculator too, and the result is correct for those.

It seems without a question that

$$\lim_{n \to \infty} s_n = 1,$$

however this does need a mathematical proof (who knows, maybe terms after $$n = 100$$ suddenly start diverging...).

## Question:

Using either the continued fraction form or the closed form prove mathematically that $$\lim_{n \to \infty} s_n = 1$$.

Note that $$\frac{a+1}{a+\frac{b\pm 1}{b}}=\frac{ab+b}{ab+b\pm 1}$$, and this "wrapping" of ratios of consecutive positive integers uses larger ones, so each term in this sequence is of the form $$\frac{c_n}{c_n\pm 1}$$, with $$\lim_{n\to\infty}c_n=\infty$$.