[Math] the proof of finding the LCM of numbers by prime factorization method

arithmeticelementary-number-theory

Fir example on the internet I found this method to find the LCM :

Let's find the LCM of 30 and 45. One way to find the least common multiple of two numbers is to first list the prime factors of each number.

30 = 2 × 3 × 5

45 = 3 × 3 × 5

Then multiply each factor the greatest number of times it occurs in either number. If the same factor occurs more than once in both numbers, you multiply the factor the greatest number of times it occurs.

2: one occurrence 
3: two occurrences 
5: one occurrence 

2 × 3 × 3 × 5 = 90 <— LCM

How would I go about proving that this method works for all numbers ? Is there a way ?

Best Answer

Hint: For each prime $p$, let $v_p(n)$ the exponent of $p$ in the prime decomposition of $n$ ($p$-valuation of $n$). Of course, $v_p(n)=0$ for all but a finite number of primes.

Prove this lemma:

$n$ is a multiple of $a$ if and only if, for all primes, $\;v_p(n)\ge v_p(a).$

Hence $n$ is a common multiple of $a$ and $b$ if and only if …