I was reading Wikipedia's article for nested radicals (link here), when I stumbled across Ramanujan's problem. I was following along fine until it got to the step where $F(x+n)$ had to be simplified. The page simply says:
$F(x)^2 = ax+(n+a)^2 +xF(x+n)$
It can then be shown that
$F(x) = x + n + a$
All I'm really asking for is a clarification as to what happens between those two statements. Basically, how can $F(x+n)$ be shown to be simplified to $x+2n+a$ (which is the necessary result for the algebra to work out?
Let be $$ F(x)= \sqrt{ax+(n+a)^2 +x\color{red}{\sqrt{a(x+n)+(n+a)^2+(x+n) \sqrt{\mathrm{\cdots}}}} }\tag 1 $$ Observe that replacing $x$ in (1) by $x+n$ we have $$F(x+n)= \sqrt{a(x+n)+(n+a)^2 +(x+n) \sqrt{\mathrm{\cdots}}}\tag 2$$ and we see that the (2) is just the red part in (1). So we have $$ F(x)= \sqrt{ax+(n+a)^2 +x\color{red}{F(x+n)} }\tag 3 $$
Squaring both sides gives us
$$F(x)^2 = ax+(n+a)^2 +xF(x+n)\tag 4$$
Put $$F(x)=x + n + a\tag 5$$ By successive substitutions of (5) in (3) we have the proof of (5)=(1).