Is there a general method for testing numbers to see if they are perfect $n$th powers?
For example, suppose that I did not know that $121$ was a perfect square. A naive test in a code might be to see if $$\lfloor\sqrt{121}\rfloor=\sqrt{121}$$
But I imagine there are much more efficient ways of doing this (if I'm working with numbers with many digits).
See Detecting perfect powers in essentially linear time - Daniel J. Bernstein:
https://cr.yp.to/papers/powers-ams.pdf
Bernstein also has an updated algorithm which can be found here: https://cr.yp.to/papers.html#powers2