I generalized the sum of all numbers less than or equal to k that are multiples of $a, b, c, d,\ldots$ but I used the formula for the union of $n$ sets. Afterwards, soemone told me that I was "over-complicating it" because the generalization could easily be achieved using the least common multiple function. Here's my problem: I don't remember how I was told I could do it. I thought that they had told me to just subtract all the multiples of $\operatorname{lcm}(a, b, c,\ldots)$ like so:
$\sum_{i=1}^{\lfloor k/a\rfloor}ai + \sum_{i=1}^{\lfloor k/b\rfloor}bi + \sum_{i=1}^{\lfloor k/c\rfloor}ci + \cdots-\sum_{i=1}^{\lfloor k/\operatorname{lcm}(a,b,c,\ldots)\rfloor}\operatorname{lcm}(a,b,c,\ldots)i$
(the first three "sigmas" are the sum of all the numbers under k that are multiples of $a$, $b$ and $c$ disregarding non-unique multiples)
but then I realized that would be wrong, since there could be numbers that are multiples of $a$ and $b$ that are not multiples of $c$, which the least common multiple function could never account for. So, my question is, what might have they told me? I know for a fact that they mentioned $\operatorname{lcm}(x)$. What methods for generalizing this make us of the least common multiple function? Thank you.