Calculate the sum of those integers from to (both inclusive) which are not divisible by or .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
It's probably easiest to calculate the complement first.
The sum of the integers between 1 and 1 0 0 inclusive that are divisible by 3 is
k = 0 ∑ 3 3 ( 3 k ) = 3 ∗ 2 3 3 ∗ 3 4 = 1 6 8 3 .
The sum of the integers between 1 and 1 0 0 inclusive that are divisible by 5 is
k = 0 ∑ 2 0 ( 5 k ) = 5 ∗ 2 2 0 ∗ 2 1 = 1 0 5 0 .
The sum of the integers between 1 and 1 0 0 inclusive that are divisible by 1 5 is
k = 0 ∑ 6 ( 1 5 k ) = 1 5 ∗ 2 6 ∗ 7 = 3 1 5 .
By the principle of inclusion/exclusion, the sum of the integers between 1 and 1 0 0 inclusive which are divisible by 3 or 5 is then 1 6 8 3 + 1 0 5 0 − 3 1 5 = 2 4 1 8 .
The sum of the integers between 1 and 1 0 0 inclusive which are not divisible by 3 or 5 is then
2 1 0 0 ∗ 1 0 1 − 2 4 1 8 = 2 6 3 2 .