methods to test whether the square and cube roots of a number are rational