# Sequence of continued fractions

Define a sequence like below $$\{x_n\}_{n=1}^{\infty}\\x_n=2+\frac{k_1}{2+\frac{k_2}{\ddots+\frac{k_n}{2}}}$$and $$k_1,k_2,...,k_n \in \{5,20\}$$ What is the $max\{x_n\},min\{x_n\} ?$
I tried to put all of them $5,20$ but , get stuck . The key answer is $max=10, min=2.5$
can you help me . Thanks in advance.

• You don't stop: 6 questions in 6 hours ? Do you have time for you in between ? – Jean Marie Sep 8 '17 at 13:08
• @JeanMarie :friday is my free day . usually I am solving in a week ,and my questions begin to appear in my free time . – Khosrotash Sep 8 '17 at 13:14
• $2 + \frac{k_1}{a}$ is large when $k_1$ is large and $a$ small, and it's small when $k_1$ is small and $a$ large. – Daniel Fischer Sep 8 '17 at 13:23

For $a_i>0$ $$2+\frac{k_1}{a_1}\quad\text{is maximized when k_1=20 and a_1 is minimized}$$ $$a_1=2+\frac{k_2}{a_2}\quad\text{is minimized when k_2=5 and a_2 is maximized}$$ $$a_2=2+\frac{k_3}{a_3}\quad\text{is maximized when k_3=20 and a_3 is minimized}$$ and so on. Therefore, $\lim\sup_{n\to \infty}x_n$ is given by $$2+\frac{20}{2+\frac{5}{2+\frac{20}{2+\frac{5}{2+...}}}}$$ A similar argument works when you want to find the minimum.
• Actually, that's the $\limsup_{n\to\infty}x_n$. The max is simply $x_1$, using the strategy outlined here. – Simply Beautiful Art Sep 8 '17 at 13:44