Find the sum of all positive integers not greater than 10000 that are divisible by either 3 or 11 but not by both of them.
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.
Basically we have to sum all the multiples of 3 less than 1 0 0 0 0 with all the multiples of 1 1 less than 1 0 0 0 0 and subtract 2 times all the multiples of 3 3 less than 1 0 0 0 0 (which were added two times: one in the summation of the multiples of 3 and one in the summation of the multiples of 1 1 )
We first have to count how many multiples of 3 , 1 1 and 3 3 there are less than 1 0 0 0 0 , which are respectively
⌊ 3 1 0 0 0 0 ⌋ = 3 3 3 3
⌊ 1 1 1 0 0 0 0 ⌋ = 9 0 9
⌊ 3 3 1 0 0 0 0 ⌋ = 3 0 3
Hence the required sum is
S = i = 1 ∑ 3 3 3 3 3 i + j = 1 ∑ 9 0 9 1 1 j − 2 k = 1 ∑ 3 0 3 3 3 k = 3 i = 1 ∑ 3 3 3 3 i + 1 1 j = 1 ∑ 9 0 9 j − 6 6 k = 1 ∑ 3 0 3 k = 3 ⋅ 2 3 3 3 3 ⋅ 3 3 3 4 + 1 1 ⋅ 2 9 0 9 ⋅ 9 1 0 − 6 6 ⋅ 2 3 0 3 ⋅ 3 0 4 = 1 8 1 7 8 1 8 2