Compute the LCM across any list of positive integers.
The calculator takes the LCM of the first two numbers, then takes the LCM of that result with the next number, and so on down the list — LCM is associative, so this pairwise approach gives the correct LCM for any number of values.
Multiplying a and b counts their shared factors twice, so dividing by their greatest common divisor removes that double-count, leaving the smallest number both a and b divide into evenly.
It breaks each input down into its prime building blocks (e.g. 12 = 2² × 3). Comparing these factorizations side by side makes it easier to see why the LCM takes the highest power of each prime that appears.