Worked example
For 84 and 30, Euclid’s algorithm gives GCD 6. Their LCM is 84×30/6 = 420. To add 2/3 and 5/6, rewrite the first fraction as 4/6 and obtain 9/6 = 3/2.
Limitations
Factorization uses bounded trial division rather than a general large-integer factorization algorithm. Combination counts are limited to n ≤ 1000.