Given prime factorizations of positive integers a and b,

Then gcd(a,b) = .

Example: gcd(255, 675) = = 3 * 5 = 15

However, factoring is not a polynomial time algorithm.