Finding LCM by using Prime Factors