Not too long ago, a person who shall not be named challenged me to a math problem apparently believing I wouldn’t be able to solve it.

The problem is to solve for $x$

$$x=\sqrt{5+\sqrt{5+\sqrt{5+\cdots}}}.$$ These kind of problems are called infinitely nested radicals and look daunting but are actually quite easy to solve. The hurdle people are confused by is the concept of infinity. For this particular case, the trick is just realizing that $x$ appears in its own definition.

\begin{aligned} x&=\sqrt{5+\sqrt{5+\sqrt{5+\cdots}}}\\ x&=\sqrt{5+x}\\ x^2&=5+x\\ x^2-x-5&=0. \end{aligned}

Using the quadratic formula and verifying your outputs will give you $\boxed{\frac{1+\sqrt{21}}{2}}$ as the answer.

Now, here’s a challenge for you :)

Find $x$ when

$x=1+\frac{1}{2+\frac{1}{3+\frac{1}{4+\cdots}}}$