LCM from Prime Decomposition

Theorem
Let $m, n \in \Z$.

Let:
 * $m = p_1^{k_1} p_2^{k_2} \ldots p_r^{k_r}$
 * $n = p_1^{l_1} p_2^{l_2} \ldots p_r^{l_r}$
 * $p_i \mathrel \backslash m \lor p_i \mathrel \backslash n, 1 \le i \le r$.

That is, the primes given in these prime decompositions may be divisors of either of the numbers $m$ or $n$.

Note that if one of the primes $p_i$ does not appear in the prime decompositions of either one of $m$ or $n$, then its corresponding index $k_i$ or $l_i$ will be zero.

Then:


 * $\lcm \left\{{m, n}\right\} = p_1^{\max \left\{{k_1, l_1}\right\}} p_2^{\max \left\{{k_2, l_2}\right\}} \ldots p_r^{\max \left\{{k_r, l_r}\right\}}$

where $\lcm \left\{{m, n}\right\}$ denotes the lowest common multiple of $m$ and $n$.