Least Common Multiple using Prime Factorization