Finding Greatest Common Factors Using Prime Factorization