The sum of all the elements in the set of and 2040 is is equal to _________.
Solution
Core idea. Numbers free of several primes are found by inclusion and exclusion on the multiples.
Concept refresher. The sum of the multiples of up to a given bound, when there are of them, is
Picture the situation. Since , a number has highest common factor 1 with 2040 when it is not divisible by 2, 3, 5 or 17. The primes 2, 3 and 5 are handled together by inclusion and exclusion on the sums of their multiples. The prime 17 has very few multiples up to 100 and is handled at the end.
Approach. Apply inclusion and exclusion to the sums of multiples of 2, 3 and 5, then remove the multiples of 17 that remain.
Step 1: Sums of multiples
Up to 100 the numbers add to 5050. The multiples of 2, 3 and 5 add to 2550, 1683 and 1050; those of 6, 10 and 15 add to 816, 550 and 315; and those of 30 add to 180.
Step 2: No factor 2, 3 or 5
By inclusion and exclusion the numbers divisible by 2, 3 or 5 add to , so the others add to .
Step 3: Remove multiples of 17
Of the multiples of 17 up to 100, namely 17, 34, 51, 68 and 85, only 17 has no factor 2, 3 or 5. So the required sum is .
Answer. 1251
Sanity check. Up to 30 the numbers with no factor 2, 3 or 5 are 1, 7, 11, 13, 17, 19, 23, 29; the pattern repeats every 30, giving 26 such numbers up to 100, and 26 numbers averaging about 49 add to about 1268.
Common wrong answers
- 1268: Forgetting the prime factor 17 of 2040 gives 1268.
- 1013: Removing all five multiples of 17, which add to 255, gives 1013; four of them had already been removed.
Key takeaway
The trap. Every prime factor of the given number must be excluded, however large.
How toppers think. They treat the small primes together and the large prime by a short list.
Remember.
More on Inclusion–Exclusion Principle
- The number of seven-digit numbers, that can be formed by using the digits 1, 2, 3, 5 and 7 such that each…
- The number of permutations, of the digits 1, 2, 3, …, 7 without repetition, which neither contain the string…
- The total number of 4-digit numbers whose greatest common divisor with 54 is 2, is
- All 7 on Inclusion–Exclusion Principle ›