Is there an algorithm for determining whether an expression involving nested radicals is rational? Specifically, consider expressions involving integers, addition, multiplication, division, and nth roots for any positive integer n. Is there an algorithm that can determine whether such an expression is a rational number? If the expression is a rational number, is it possible to determine which rational number (e.g. test whether an expression is 0?
I've seen papers on denesting radicals, but I couldn't find anything on testing for rationality.
 A: If you're only interested in a root of each radical, rather than the unique positive real root or another chosen root, then you only have to keep track at each step of the rational polynomial whose roots are all the possible values of that expression.
In this case, it's probably best to compute it inductively, inside-out. Given polynomials $f(x)$ and $g(x)$, we can find polynomials whose roots are the roots of $f$ plus the roots of $g$, the roots of $f$ times the roots of $g$, and so on for the other arithmetic operations. For radicals this process is particularly simply, as we just replace $f(x)$ with $f(x^n)$. At the end you have a rational polynomial and can test for rational roots.
I don't know the best way to compute each step. One possibility is to view it as a matrix problem, forming the companion matrices $M_f, M_g$ to $f$ and $g$, taking $M_f \otimes I + I \otimes M_g$ or $M_f \otimes M_g$, and calculating the characteristic polynomial. 
Regardless, because this method involves manipulating polynomials with integer coefficients, it's probably best to handle it by working mod $p$ for many large $p$ and then using the Chinese remainder theorem.
If your expression has a simple form then there are many tricks which you can possibly do to check if it has a rational root. For instance if your whole expression is wrapped in a single radical which is then added, multiplied with, and divided by other numbers, then the final output is rational if and only if this radical is rational, and this radical is rational only if the term inside is rational, potentially  allowing you to prove irrationality by considering only a smaller sub-expression.
A: An algorithm to check whether an expression $f$ involving nested radicals is 0 may be obtained from a general procedure to check whether a semialgebraic set is non-empty. Indeed, you may introduce new variables, to replace each radical $\sqrt{a}$ (or, in general $a^{1/n_a}$) with $\alpha$, with extra equation $\alpha^2=a$ (or, in more generality, for each $a^{1/n_a}$ the equation will be $\alpha^{n_a}=a$) and inequality $\alpha \geq 0$.
This will convert $f$ into a multivariate polynomial, so you will end up with a system of polynomial equations and inequalities, which you will need to test for a solution (something known to be doable in polynomial time for fixed number of inequalities and variables).

EDIT: this way one can also solve the full problem in question, i.e. finding whether $f\in\mathbb{Q}$. To this end, we can, instead of the "converted" as above equation $f=0$ we can consider the equation $f=\alpha_0$, where $\alpha_0$ yet another variable. Then the procedure as above will produce a finite semialgberaic set, defined in terms of the variables $\alpha$ introduced while eliminating radicals, and $\alpha_0$. In particular, it will be possible to construct a univariate polynomial $p\in\mathbb{Z}[\alpha_0]$, so that the value of $f$ is one of the (real) roots of $p$. Thus the linear terms of the factorisation of $p$ over $\mathbb{Q}$ will either produce the rational value of $f$, or indication that it is not rational.
Details of these algorithms may be found in e.g. S.Basu, R.Pollack, M.-F.Roy's book Algorithms in Real Algebraic Geometry.
A: I'm assuming that you stay within the field of real numbers. You can represent an algebraic real number $\alpha$ by its minimal polynomial $P_\alpha$ plus an additional data, such as the position of $\alpha$ in the set of real roots of $P_\alpha$ (I think there are more efficient encodings). In any case, the main point is that all the usual operations on real algebraic numbers, including real radicals, can be performed exactly using the previous description. In particular, given an expression involving nested real radicals, you can compute its minimal polynomial, and then just need to look whether this polynomial has degree 1.
One reference is the book of Bochnak, Coste and Roy, Real algebraic geometry (there may be other but I don't know them). The procedure I outlined here is a very special case of quantifier elimination over real closed fields (for the field of real algebraic numbers).
A: One possible algorithm (I fear that terribly slow) would be to produce all algebraic conjugates of your expression (substituting in every possible way each radical by all it's conjugates) and finding the polynomial $\prod (x-\alpha)$ were the product is extended to all the conjugates of your number. By the symmetric function theorem this should give a polynomial with rational coefficients and then you can find it's rational and real roots and check numerically if your expression is nearest to one of the rational roots than to any other root.   
On the other hand in Cohen's Computational algebraic Number theory section 2.7.4, there is a very nice algorithm that can be used to find the minimal polynomial of an real or complex number $\alpha$, grossly simplified it finds the LLL-reduction of the matrix:
 $$ \begin{pmatrix} 1&0&\dots &0\\ 0 &1&\dots& 0\\ \vdots& & \ddots &\vdots\\ 0&0&\dots&1\\ \sqrt{N}\alpha^{n-1} & \sqrt{N}\alpha^{n-2}&\dots& \sqrt{N} \end{pmatrix} $$
For a suitable $N$ where $n$ is an upper bound of the expected degree of the relation. Usually the first column will give you a relation of the $\alpha^i$ with reasonably small coefficients which possibly has $\alpha$ as a root and then you can proceed as before. However I'm not sure if there is any guaranty of finding the poynomial. (This algorithm is implemented in the software Pari-Gp son you can check it downloading the program). 
Here is an example taken from a note of Daniel Shanks: Incredible identities (A, B, C):
$$ \sqrt{5} + \sqrt{22+2\sqrt{5}} = \sqrt{11+2\sqrt{29}} + \sqrt{16-2\sqrt{29}+2\sqrt{55-10\sqrt{29}}} $$ 
both sides are equal to 7.381175940895657970987266875465130332 using algdep you find that the minimal polynomial of both sides is probably 
$$x^4-54x^2-40x+269$$
and you can check algebraically that both sides are actually roots of this polynomial.
