I couldn't find anything on the Internet which could direct me to the solution of the following problem.
I want to know if $n$ can be calculated by $x^y$ where $y\ge 2$ and $x\ge 2$. I tried using $n$ modulus $x$, but this didn't worked out.
I'll use this formula in a computer application, the application must be able to apply this formula on numbers greater than $10^{14}$.
So the question is: Is there a formula to check if $n$ can be calculated by $x^y$?
Any hints, links and answers are appreciated. If you need more information, please feel free to ask.
Greetings,
Mixxiphoid
Update:
In my application I have a given number n, this can be really anything. Anything here means larger than 1 and smaller than a number with one million digits, which is a pretty big range.
Now I need to know if n can be calculated with any power (NOT a product).
Example:
if n = 27. The formula should return true with: x = 3, y = 3.
if n = 12. The formula should return false. since it can only be calculated with products.
if n = 64. The formula should return true with: x = 2, y = 6.
NOTE: I need the smallest x. In the third example x could have been 8 with y = 2. But since I want the smallest x, I want x to be 2.
I need to know whether it is true or false. If the formula returns true, I also need to know x.
In all cases n, x and y should be positive whole numbers!
Update 2 Although I accepted an answer, new answers to improve the method are still welcome!