If given an integer n = pq, p and q are primes, and a way of computing phi(n) in polynomial time is given. Can we also get the value of p and q in polynomial time? The answer is we can, but how? We can use the method given for finding phi(n) in polynomial time.
Edit:
sorry for causing people to argue, I changed co-prime to prime now. The original problem is solved, but I'm still curious if this conclusion has a general form, I mean if n actually equals to p * r * s * ....It should still be able to get the most basic primes in polynomial time. How to prove?
You have a system of two equations in two unknowns:
$$ n = pq \qquad \qquad \varphi(n) = (p-1)(q-1) $$