Find the limit of $(x_n)$ defined by $x_{n+1}=c_nu(x_n)$ Find $\displaystyle \lim_{n\rightarrow \infty }x_n$ :
$$\left\{\begin{matrix}x_1=a>0\\ \\ x_{n+1}=\frac{2x_n\cdot \cos\left(\frac{\pi}{2^n+1}\right)}{x_n+1}\end{matrix}\right.$$
I have tried that :
Let $a_n=\dfrac{1}{x_n}$ . So :
$$a_{n+1}=\frac{1}{2\cos\left(\frac{\pi}{2^{n+1}}\right)}.a_n+\frac{1}{2\cos\left(\frac{\pi}{2^{n+1}}\right)}$$
So I tried to have geometric series: 
By let :
$$a_{n+1}+f(n+1)=\frac{1}{2\cos\left(\frac{\pi}{2^{n+1}}\right)}(a_n+f(n))$$
So we must find one $f(n)$:
$$\frac{f(n)}{2\cos\left(\frac{\pi}{2^{n+1}}\right)}-f(n+1)=\frac{1}{2\cos\left(\frac{\pi}{2^{n+1}}\right)}$$
As $$f(n)-f(n+1)\cdot 2\cos\frac{\pi}{2^{n+1}}=1$$
Can you give me the way to find one $f(n)$ sastisfied that ; or anyone has nice way to solve this problem


$$\lim\limits_{n\to\infty}x_n=1$$

To show this, note that: first, $x_n\gt0$ for every $n\geqslant1$; second, $x_n\leqslant x^0_n$ for every $n\geqslant1$, where $x^0_1=a$ and 
$$
x^0_{n+1}=\frac{2x^0_n}{x^0_n+1},
$$ 
for every $n\geqslant1$; third, $x^0_n\to1$ when $n\to\infty$. Thus, $\limsup\limits_{n\to\infty}x_n\leqslant1$.
On the other hand, $\cos\left(\frac\pi{2^n+1}\right)\to1$ when $n\to\infty$. For every positive $b\lt1$, choose some positive integer $n(b)$ such that $\cos\left(\frac\pi{2^n+1}\right)\geqslant b$ for every $n\geqslant n(b)$ and define $(x^b_n)_{n\geqslant n(b)}$ by $x^b_{n(b)}=x_{n(b)}$ and 
$$
x^b_{n+1}=\frac{2bx^b_n}{x^b_n+1},
$$ 
for every $n\geqslant n(b)$. Then, $x_n\geqslant x^b_n$ for every $n\geqslant n(b)$ and, provided $b\gt\frac12$, $x^b_n\to x^b=2b-1$ when $n\to\infty$. 
Hence $\liminf\limits_{n\to\infty}x_n\geqslant x^b$. Since $x^b\to1$ when $b\to1$, this proves the result.

The same method shows that every sequence $(x_n)_{n\geqslant1}$ defined by $x_1=a\gt0$ and 
$$
x_{n+1}=\frac{c_nx_n}{x_n+1},
$$ 
for every $n\geqslant1$, with $c_n\gt0$ for every $n\geqslant1$ and $\lim\limits_{n\to\infty}c_n=c$ with $c\geqslant1$, converges to $c-1$. If $0\leqslant c\leqslant1$, $\lim\limits_{n\to\infty}x_n=0$.
