Just study the famous paper PRIMES is in P and get confused.
First step of the proposed algorithm is If (n=a^b for nature number a and b>1), output COMPOSITE. Since the whole algorithm runs in polynomial time, this step must also complete in O((log n)^c)(given input size is O(log n). However, I can’t figure out any algorithm to hit the target after some googling.
QUESTION:
Is there any algorithm available to test whether a number exponent of some other number in polynomial time?
Thanks and Best Regards!
If
n=a^b(for a > 1) then b ≤ log2 n, we can check for allb‘s smaller thanlog nto test this, we can iterate for findingbfrom 2 to log n, and for findingawe should do binary search between 1..sqrt(n). But binary search takes O(logn) time for iteration, finally in each step of search(for any foundafor checking) we should check that whether ab == n and this takes O(log n), so total search time will be O(log3n). may be there is a faster way but by knowing that AKS is O(log6n) this O(log3n) doesn’t harm anything.