The simple binomial theorem of degree 2 can be written as:
${(x+a)}^2=x^2+2xa+a^2 \ \ldots (1)$
Replacing $a$ by $(n+a)$ where $x, n, a \in \mathbb{R}$ , we can have
${(x+(n+a))}^2= x^2+2x(n+a)+{(n+a)}^2$
or, ${(x+n+a)}^2 =x^2+2xn+2ax+{(n+a)}^2$
Arranging terms in a way that
${(x+n+a)}^2 =ax+{(n+a)}^2+x^2+2xn+ax=ax+{(n+a)}^2+x(x+2n+a)$
Taking Square-root of both sides
or,
$$x+n+a=\sqrt{ax+{(n+a)}^2+x(x+2n+a)} \ \ldots (2)$$
Take a break. And now think about $(x+2n+a)$ in the same way, as:
$x+2n+a =(x+n)+n+a$ .
Therefore, in equation (2), if we replace $x$ by $x+n$ , we get
$x+2n+a=(x+n)+n+a=\sqrt{a(x+n)+{(n+a)}^2+(x+n)((x+n)+2n+a)}$
or, $x+2n+a=\sqrt{a(x+n)+{(n+a)}^2+(x+n)(x+3n+a)} \ \ldots (3)$
Similarly, $x+3n+a=\sqrt{a(x+2n)+{(n+a)}^2+(x+2n)(x+4n+a)} \ \ldots (4)$
and also, $x+4n+a=\sqrt{a(x+3n)+{(n+a)}^2+(x+3n)(x+5n+a)} \ \ldots (5)$
Similarly,
$x+kn+a=\sqrt{a(x+(k-1)n)+{(n+a)}^2+(x+(k-1)n)(x+(k+1)n+a)} \ \ldots (6)$ where, $k \in \mathbb{N}$ .Putting the value of $x+2n+a$ from equation (3) in equation (2), we get:
$x+n+a=\sqrt{ax+{(n+a)}^2+x\sqrt{a(x+n)+{(n+a)}^2+(x+n)(x+3n+a)}} \ \ldots (7)$
Again, putting the value of $x+3n+a$ from equation (4) in equation (7), we get
$x+n+a =\sqrt{ax+{(n+a)}^2+x\sqrt{a(x+n)+{(n+a)}^2+(x+n)\sqrt{a(x+2n)+{(n+a)}^2+(x+2n)(x+4n+a)}}} \ \ldots (8)$
Generalizing the result for $k$ -nested radicals:
$$x+n+a =\\ \sqrt{ax+{(n+a)}^2+x\sqrt{a(x+n)+{(n+a)}^2+ \\ (x+n)\sqrt{a(x+2n)+{(n+a)}^2+(x+2n)\sqrt{\ldots +(x+(k-2)n)\sqrt{a(x+(k-1)n)+ \\ {(n+a)}^2+x(x+(k+1)n+a)}}}}} \ \ldots (9)$$
This is the general formula of Ramanujan Nested Radicals up-to $k$ roots.

### Some interesting points

As $x,n$ and $a$ all are real numbers, thus they can be interchanged with each other.
i.e.,

$$x+n+a = \\ \sqrt{ax+{(n+a)}^2+x\sqrt{a(x+n)+{(n+a)}^2+(x+n)\sqrt{a(x+2n)+{(n+a)}^2+(x+2n)\sqrt{\ldots+(x+(k-2)n)\\ \sqrt{a(x+(k-1)n)+{(n+a)}^2+x(x+(k+1)n+a)}}}}}) \\=\sqrt{an+{(x+a)}^2+n\sqrt{a(n+x)+{(x+a)}^2+(n+x)\sqrt{a(n+2x)+{(x+a)}^2+(n+2x)\sqrt{\ldots+(n+(k-2)x) \\ \sqrt{a(n+(k-1)x)+{(x+a)}^2+n(n+(k+1)x+a)}}}}}) \\=\sqrt{xa+{(n+x)}^2+a\sqrt{x(a+n)+{(n+x)}^2+(a+n)\sqrt{x(a+2n)+{(n+x)}^2+(a+2n)\sqrt{\ldots+(a+(k-2)n) \\ \sqrt{ x(a+(k-1)n)+{(n+x)}^2+a(a+(k+1)n+x)}}}}} \ \ldots (10)$$

etc.

Putting $n=0$ in equation (9)
we have
$x+a =\sqrt{ax+{a}^2+x\sqrt{ax+{a}^2+x\sqrt{ax+{a}^2+x\sqrt{\ldots+x\sqrt{ax+{a}^2+x(x+a)}}}}} \ \ldots (11)$
or just, $x+a =\sqrt{ax+{a}^2+x\sqrt{ax+{a}^2+x\sqrt{ax+{a}^2+x\sqrt{\ldots}}}} \ \ldots (12)$

Again putting $x=1 \ a=0$ in (9)

$1+n =\sqrt{{n}^2+\sqrt{n^2+(1+n)\sqrt{{n}^2+(1+2n)\sqrt{\ldots+(1+(k-2)n)\sqrt{{n}^2+1+(k+1)n}}}}} \ldots (13)$

Putting $x=1 \ a=0$ in equation (8)
$1+n =\sqrt{{n}^2+\sqrt{{n}^2+(1+n)\sqrt{{n}^2+(1+2n)(1+4n)}}} \ \ldots (14)$

Again putting $x=a=n$ =n(say) then
$3n=\sqrt{n^2+4{n}^2+n\sqrt{2n^2+4{n}^2+2n\sqrt{3n^2+4{n}^2+3n\sqrt{\ldots+(k-1)n\sqrt{kn^2+4{n}^2+(k+3)n^2}}}}}$
or, $3n=\sqrt{5{n}^2+n\sqrt{6{n}^2+2n\sqrt{7{n}^2+3n\sqrt{\ldots+(k-1)n\sqrt{(k+4)n^2+(k+3)n^2}}}}} \ \ldots (15)$

Putting $n=1$ in (15)
$3=\sqrt{5+\sqrt{6+2\sqrt{7+3\sqrt{\ldots+(k-1)\sqrt{(2k+7)}}}}} \ \ldots (16)$

Putting $x=n \in \mathbb{N}$ and $a=0$ in (9) we get even numbers
$2n =\sqrt{{n}^2+n\sqrt{{n}^2+2n\sqrt{{n}^2+3n)\sqrt{\ldots+(k-1)n\sqrt{(k-1)n)+{n}^2+(k+2)n^2}}}}} \ \ldots (17)$

Similary putting $x=n \in \mathbb{N}$ and $a=1$ in (9) we get a formula for odd numbers:
$$2n+1 =\sqrt{n+{(n+1)}^2+n\sqrt{2n+{(n+1)}^2+2n\sqrt{3n+{(n+1)}^2+3n\sqrt{\ldots+(k-1)n\sqrt{kn+{(n+1)}^2+(k+2)n^2+n}}}}} \ \ldots (18)$$
or,
$$2n+1 =\sqrt{n+{(n+1)}^2+n\sqrt{2n+{(n+1)}^2+2n\sqrt{3n+{(n+1)}^2+3n\sqrt{\ldots+(k-1)n\sqrt{(k+3)n^2+(k+3)n+1}}}}} \ \ldots (19)$$