Finding GCD by using Prime Factors