Let $\sqrt{n+\sqrt{n+\sqrt{n+...+\sqrt{n+f(n)}}}}=x$. Therefore, $$n+\sqrt{n+\sqrt{n+...+\sqrt{n+f(n)}}}=x^2$$ $$x^2-x-n=0$$ $$x=\sqrt{n+\sqrt{n+\sqrt{n+...+\sqrt{n+f(n)}}}}=\frac{1 \pm \sqrt{1+4n}}{2}$$
It seems counter-intuitive at first that $f(n)$ doesn't have an effect on the final answer. If $f(n)$ were $\frac{1}{n!}$ or $e^{2.3n^2}$, or anything else for that matter, we still get the same formula for the result.
My question regarding this is:
- Is this applicable for any $f(n)$ at the end of the infinite nested radical (I haven't studied much about properties of functions but have heard of terms like 'odd function', 'even function', '$f: \mathbb{R} \to \mathbb{R}$' etc)?
- Is this result because of the infinitesimally small effect of $f(n)$ on the result?
EDIT : Some people have commented that there is '1 less $n$ post squaring'. There are infinite '$\sqrt{n+\sqrt{}}$' before I added $f(n)$ at the end.
Firstly, note that you actually don't need the function $f$. You only need its value at point $n$ and we can mark it $x_0=f(n)$.
You actually invented the fixed point iteration. You are iterating the equation $x_{m+1}=\sqrt{n+x_m}$. You noticed that this may have two solutions. Let's mark them: $$ \bar{x}_1=\frac{1+\sqrt{1+4n}}{2}\\ \bar{x}_2=\frac{1-\sqrt{1+4n}}{2} $$ The solution $\bar{x}_1$ will be always valid, while $\bar{x}_2$ will be valid only for $n \in \left[-\frac14;0\right]$. For small $n$, it will be imaginary, and for big $n$, it will be negative and square root can't be negative in real numbers.
The iterated function $x_{m+1}=\sqrt{n+x_m}$ is contractive (i.e. its first derivation is in range $(-1;1)$) in $\bar{x}_1$ except one case but never in $\bar{x}_2$. The only case, in which the function isn't contractive in $\bar{x}_1$ is when $n=-\frac14$ and $\bar{x}_1=\bar{x}_2$. So there are a few cases which may happen:
As you see, in cases 3 and 4, it actually depends on the choice of $x_0$.