Prime factorization and highest common factor (HCF)