Is there a general identity for the infinite radicals; $$f(n)=\sqrt{n^{0}+\sqrt{n^{1}+\sqrt{n^{2}+\sqrt{n^{3}+...}}}}$$
For $n=0,1,4$ we get $f(n)=1,φ,2$ respectively (If you allow that $0^0=1)$ but will there be any other value of $n$ such that $f(n)∈ \mathbb{Z}$ or even has a closed-form expression? This is actually such an interesting nested radical, that I was unable to even find a good proof for $f(4)=2$. Most of them were reverse-engineering the radical and showing but not proving.
So is there a closed form expression for this as general or even for any other value of $m$ I missed out?
A C++ code for computing this can be given as;
#include <iostream>
#include <math.h>
using namespace std;
long double seq( unsigned long, long double, unsigned long = 0 );
int main() {
unsigned long m = 0; long double n;
cout << "Enter integer r: ";
cin >> m; cout << "Enter n: ";
cin >> n; cout << seq( m, n); return 0;
}
long double seq( unsigned long m, long double n, unsigned long i) {
return sqrt( pow(n,i)+(i==m?0:seq(m,n,i+1)) );
}
Where input $r$ means how many times you need to continue the radicals, and $n$ will be the number you want to put in.
Edit;
Maybe a trivial finding, but I also got that
$$f(n)=\sqrt{1+n^{\delta(1)}\sqrt{1+n^{\delta(2)}\sqrt{1+n^{\delta(3)}\sqrt{1+...}}}}$$
Where,
$$\delta(x)=(1-x)+\frac{1}{2x}$$
You are studying the limit of nested radicals of the form
$$a_{k} = \sqrt {x^0 + \sqrt{x^1+\cdots +\sqrt{x^k}}}$$
There is a theorem by Herschfeld (On infinite radicals, 1935) that shows $a_k$ converges if and only if the sequence
$$F_k := (x^k)^{1/2^k} = x^{k/2^k}$$
is bounded. This happens for every $x\in \mathbb{N}$.
In the article by Herschfeld there are several results on nested radicals (including the case for $x=n^2$ which comprises your request $x=4$) of this form but also of the "left-hand" form
$$u_k = \sqrt{a_k + \sqrt{a_{k-1}+\ldots +\sqrt{a_0}}}$$
of which the author is able to calculate the general limit in terms of the limit of sequence $\{a_k\}$.