lcm(a, b) = |a × b| ÷ gcd(a, b), applied iteratively across all values
lcm(4, 6): gcd(4,6)=2 → (4×6)/2 = 12.
The LCM is computed pairwise and accumulated across the list using the same formula.
gcd(a,b) × lcm(a,b) = a × b for any two positive integers.