<s>[INST] proof for the Ramanujan's formula ? I found this formula in a textbook in which the proof to the formula was not given
Ramanujam's formula
$$\sqrt{1 +n\sqrt{1 +(n+1)\sqrt{1 + (n+2)\sqrt{1 + (n+3)\sqrt{1 +....\infty}}}}} = n+1$$
Its a great equation andhow do you prove this. its a bit difficult for me and tried different methods to solve this. Iam an undergraduate and I want you to elaborate the method of solving if its complex.  
 [/INST] For all $x > 0$ and $m \in \mathbb{N}$, define $\varphi_m(x)$ by:
$$(x+1)\varphi_m(x) = \begin{cases}1,&\text{ for } m = 0\\
\\
\sqrt{1+x\sqrt{1+(x+1)\sqrt{\cdots\sqrt{1+(x+m)}}}},&\text{ otherwise. }\end{cases}$$
It is clear for $m > 0$, these functions satisfy the recurrence relations:
$$\begin{align}
     &(x+1)^2\varphi_{m}(x)^2 = 1 + x(x+2)\varphi_{m-1}(x+1)\\
\iff &\varphi_{m}(x)^2 = \varphi_{m-1}(x+1) + \frac{1 - \varphi_{m-1}(x+1)}{(x+1)^2}
\end{align}
$$
Notice for any $x > 0, y \in [0,1]$, we have $y + \frac{1-y}{(x+1)^2} \in [y,1]$. This implies
$$\varphi_{m-1}(x+1) \le \varphi_{m}(x)^2 \le 1
\quad\iff\quad
\varphi_{m-1}(x+1)^{2^{-1}} \le \varphi_{m}(x) \le 1$$
Repeat apply this to $\varphi_{m-2}(x+2), \varphi_{m-3}(x+3),\ldots$, we get:
$$\begin{align}
&\varphi_{0}(x+m)^{2^{-m}} \le \varphi_{1}(x+m-1)^{2^{-(m-1)}} \le \cdots \le \varphi_{m}(x) \le 1\\
\implies & \left(\frac{1}{x+m+1}\right)^{2^{-m}} \le \varphi_m(x) \le 1\tag{*1}
\end{align}$$
Notice for fixed $x$, the limit of L.H.S of $(*1)$ goes to $1$ as $m \to \infty$. As a consequence:
$$\sqrt{1+x\sqrt{1+(x+1)\sqrt{1 + \cdots}}} = (x+1)\lim_{m\to\infty}\varphi_m(x) = x + 1$$
</s>