Find sum of numbers from $1-100$ which are not divisible by $3$ and$ 7$
If you are familiar with unions and intersections of sets , then it is not a difficult problem.
Your answer should be: Total sum-(sum of multiple of $3 +$ sum of multiple of $7 -$ sum of multiple of $21)$
Since $21$ is LCM of $3$ & $7$
Sum of numbers divisible by $3=1683$
Sum of numbers divisible by $7=735$
Sum of numbers divisible by $21=210$
We need the sum of divisor of $21$ since if we subtract only by the Sum of divisor of $3$ and Sum of divisor of $7$ then the numbers those are divisible by both $3$ & $7$ means divisible by $21$ will be subtracted twice but we need to subtract it only once.
$\therefore$
The sum of numbers not divisible by $3$ & $7=$ Sum of first $100$ natural numbers $-$ Sum of divisor of $3-$ Sum of divisor of $7+$ Sum of divisor of $21$
$=5050-1683-735+210$
$=2842$
Number of multiples of $3$ between $1$ & $100$ = $[\frac{100}{3}]$ = $33$,
Number of multiples of $7$ between $1$ & $100 =$ $[\frac{100}{7}]$ = $14$,
Number of multiples of $21$ between $1$ & $100$ = $[\frac{100}{21}]$ = $4$,
Where $[x]$ is the box function.
Sum of first 100 terms excluding terms divisible by $3$ and $7$:
$$ S = \sum_{i=1}^{100} i - 3\sum_{i=1}^{33} i - 7\sum_{i=1}^{14} i + 21\sum_{i=1}^4 i. $$
Apply the formula for $\sum_{i=1}^n i$ and take it from here.