<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] Here is this answer adapted to this question.
Define
$$
f(x)=\sqrt{1+x\sqrt{1+(x+1)\sqrt{1+(x+2)\sqrt{1+\dots}}}}
$$
then $f(x)^2=1+xf(x+1)$. This indicates we should look at $f(x)=x+1$.
Considering $f(x)=x+1$, we are lead to show inductively that
$$
\hspace{-18pt}x+1=\small\sqrt{1+x\sqrt{1+(x+1)\sqrt{1+\dots+\sqrt{1+(x+k-2)\sqrt{1+(x+k-1)(x+k+1)}}}}}\tag{1}
$$

Define
$$
f_{k,x}(y)=\left\{\begin{array}{}
y&\text{if }k=0\\
\sqrt{1+xf_{k-1,x+1}(y)}&\text{if }k>0
\end{array}\right.
$$
unrolled, that is
$$
f_{k,x}(y)=\small \sqrt{1+x\sqrt{1+(x+1)\sqrt{1+\dots+\sqrt{1+(x+k-2)\sqrt{1+(x+k-1)y}}}}}
$$
Note that $f_{0,x}(x+1)=x+1$. Suppose that, for some $k\ge0$, $f_{k,x}(x+k+1)=x+1$. Then
$$
\begin{align}
f_{k+1,x}(x+k+2)
&=\sqrt{1+xf_{k,x+1}(x+k+2)}\\
&=\sqrt{1+x(x+2)}\\
&=x+1
\end{align}
$$
Therefore, for all $k\ge0$, we have $f_{k,x}(x+k+1)=x+1$.
Thus $(1)$ is confirmed.

Our sequence is bounded by $f_{k,x}(1)$ and $f_{k,x}(x+k+1)$. To show that our sequence converges to $x+1$, we want to show that
$$
\lim_{k\to\infty}f_{k,x}(1)=x+1\tag{2}
$$
Note that
$$
\frac{f_{0,x+k}(x+k+1)}{f_{0,x+k}(1)}=\frac{x+k+1}{1}
$$
Suppose that, for some $j\ge0$,
$$
\frac{f_{j,x+k-j}(x+k+1)}{f_{j,x+k-j}(1)}\le(x+k+1)^{1/2^j}
$$
Then
$$
\begin{align}
\frac{f_{j+1,x+k-j-1}(x+k+1)}{f_{j+1,x+k-j-1}(1)}
&=\sqrt{\frac{1+(x+k-j-1)f_{j,x+k-j}(x+k+1)}
{1+(x+k-j-1)f_{j,x+k-j}(1)}}\\
&\le\sqrt{\frac{f_{j,x+k-j}(x+k+1)}{f_{j,x+k-j}(1)}}\\
&\le(x+k+1)^{1/2^{j+1}}
\end{align}
$$
Therefore, for all $j\ge0$,
$$
\frac{f_{j,x+k-j}(x+k+1)}{f_{j,x+k-j}(1)}\le(x+k+1)^{1/2^j}
$$
in particular, for $j=k$,
$$
\frac{f_{k,x}(x+k+1)}{f_{k,x}(1)}\le(x+k+1)^{1/2^k}
$$

Since $f_{k,x}(x+k+1)=x+1$, we have
$$
(x+1)(x+k+1)^{-1/2^k}\le f_{k,x}(1)\le (x+1)
$$
and by the squeeze theorem, we have
$$
\lim_{k\to\infty}f_{k,x}(1)=x+1
$$
confirming $(2)$, as desired.
</s>