The product is not the lcm
transcript
Two campaigns repeat on cycles. Four days, and six days. When do they line up again? The answer is smaller than you might think.
The tempting answer is to multiply. Four times six is twenty-four. But they line up sooner than that. It looks right, and it is right for some inputs.
Four is two times two. Six is two times three. They share a factor of two. Three, five and seven share nothing, so for them the product works.
The product counts the shared two twice. Keep the highest exponent of each prime. Two squared times three is twelve. Test two cycles that share a factor, such as four and six.
With a big modulus, you cannot fold pair by pair. A fold divides, and a remainder cannot be divided. So multiply the prime powers, taking the modulus as you go. Only the final product needs the modulus.
Count each prime's top exponent. Never trust a plain product. Full breakdown in the lecture.