Solution for CommonPrimeDivisors