Analyzing the Setup
To find the sum of all integers n in the range 1≤n≤100 such that H.C.F.(n,2040)=1, we must first determine the prime factorization of 2040.
Performing the prime factorization, we obtain:
2040=23×3×5×17
For n to be coprime to 2040, it must not be divisible by any of the prime factors 2,3,5, or 17.
Phase 1
The Odd Universe
Since n cannot be divisible by 2, n must be an odd number. The set of odd numbers up to 100 is {1,3,5,…,99}.
There are
50 such numbers. The sum of the first
k odd numbers is given by
k2. Therefore, the sum of our initial universe is:
Stotal=502=2500
Phase 2
The Inclusion-Exclusion Dance
We must subtract the sum of odd multiples of 3,5, and 17 from Stotal. We apply the Principle of Inclusion-Exclusion to account for overlaps.
1. Sum of odd multiples of 3:
The set is
{3,9,15,…,99}. This is
3×(1+3+5+⋯+33). Since there are
17 terms:
S3=3×172=3×289=867
2. Sum of odd multiples of 5:
The set is
{5,15,25,…,95}. This is
5×(1+3+5+⋯+19). Since there are
10 terms:
S5=5×102=500
3. Sum of odd multiples of 17:
The set is
{17,51,85}.
S17=17+51+85=153
Phase 3
Correcting for Overlaps
We must now add back the intersections that were subtracted twice:
1. Intersection of 3 and 5 (Multiples of 15):
The set is
{15,45,75}.
S15=15+45+75=135
2. Intersection of 3 and 17 (Multiples of 51):
The set is
{51}.
S51=51
3. Intersection of 5 and 17 (Multiples of 85):
The set is
{85}.
S85=85
Note that the intersection of all three (3×5×17=255) is greater than 100, so it contributes 0 to the sum.
Final Calculation
The sum of the 'bad' numbers is calculated as:
Sbad=(S3+S5+S17)−(S15+S51+S85)
Sbad=(867+500+153)−(135+51+85)
Sbad=1520−271=1249
Subtracting the 'bad' sum from our total universe sum:
Sfinal=2500−1249=1251
The final sum of all integers n≤100 coprime to 2040 is 1251.