Here's how I duplicated
Ramanujan's result,
with a lot of help from Wolfy.
Start with
$x=\sqrt{a-\sqrt{a+\sqrt{a+x}}}
$.
Squaring,
$x^2-a
=-\sqrt{a+\sqrt{a+x}}
$.
Squaring again,
$(x^2-a)^2
=a+\sqrt{a+x}
$
or
$(x^2-a)^2-a
=\sqrt{a+x}
$.
A final squaring gives
$((x^2-a)^2-a)^2-a
=x
$.
Setting
$a=2$
gives
$x
=((x^2-2)^2-2)^2-2
$.
According to Wolfy,
there are
8 real roots
of this
(including -1 and 2),
though it identifies
3 as complex roots
while giving them
as real numbers.
These are
$-1, 2,
-1.8794, 0.34730,
1.5321, -1.8019,
-0.44504, 1.2470,
$
though, for some reason,
it calls the last 3 complex.
I have no idea
how Wolfy got the roots.
Each one of them
is expressed with
$\sqrt{3}$ and
expressions involving it
and $i$,
some of them raised to the
$\frac13$ and $\frac23$
powers.
It turns out
the the fourth of these,
0.34730,
is the desired root.
This can be gotten
by asking Wolfy for
"root of
$x=\sqrt{2-\sqrt{2+\sqrt{2+x}}}$"
which gives a value
slightly less than
$0.35$.
Here is how I went
from the exact expression
for this root
given by Wolfy
to Ramanujan's expression:
$\begin{array}\\
x
&=\dfrac{-(1-i \sqrt{3})}{2^{2/3} (-1+i \sqrt{3})^{1/3}}-\frac12 (1+i \sqrt{3}) (\frac12 (-1+i \sqrt{3}))^{1/3} \\
&=\dfrac{-1+i \sqrt{3}}{2^{2/3} (-1+i \sqrt{3})^{1/3}}-\frac12 (1+i \sqrt{3}) (\frac12 (-1+i \sqrt{3}))^{1/3} \\
&=2^{-2/3}(-1+i \sqrt{3})^{2/3}-\frac12 (1+i \sqrt{3}) (\frac12 (-1+i \sqrt{3}))^{1/3} \\
&=(\frac12(-1+i \sqrt{3}))^{2/3}-\frac12 (1+i \sqrt{3}) (\frac12 (-1+i \sqrt{3}))^{1/3} \\
&=(e^{2\pi i/3})^{2/3}-e^{\pi i/3} (e^{2\pi i/3})^{1/3} \\
&=e^{4\pi i/9}-e^{(\pi i)(1/3+2/9)} \\
&=e^{4\pi i/9}-e^{(\pi i)(5/9)}
\qquad\text{(I was worried here)}\\
&=e^{4\pi i/9}-e^{(\pi i)(1-4/9)}
\qquad\text{(but then I thought of this)}\\
&=e^{4\pi i/9}-e^{\pi i}e^{-4\pi i/9} \\
&=e^{4\pi i/9}+e^{-4\pi i/9} \\
&=2\cos(4\pi /9)
\qquad\text{since }2\cos(z)=e^{iz}+e^{-iz} \\
&=2\sin(\pi/2-4\pi /9)
\qquad\text{since } \cos(z) = \sin(\pi/2-z)\\
&=2\sin(\pi/18)\\
\end{array}
$