The Harmony of Intersecting Progressions
Imagine you are standing at the edge of two infinite numerical highways. Highway X starts at 1 and jumps forward by 5 every step: 1,6,11,16,….
Highway Y starts at 9 and leaps forward by 7 every step: 9,16,23,30,…. You have been given a specific task: count how many unique numbers exist if you combine the first 2018 terms of both highways.
The Principle of Inclusion-Exclusion
To solve this, we invoke the elegant Principle of Inclusion-Exclusion. If we simply add the number of terms in X to the number of terms in Y, we are counting the 'common' numbers twice—once because they belong to X, and once because they belong to Y.
To get the true count of the union, we must subtract the intersection. Our formula is simple yet powerful:
We know n(X)=2018 and n(Y)=2018. The real mystery lies in finding n(X∩Y), the number of elements that live in both sets.
Finding the Common Ground
Let us define the general terms of our sequences. For set X, the n-th term is Tn=1+(n−1)5=5n−4. For set Y, the k-th term is Uk=9+(k−1)7=7k+2.
For a number to be in the intersection, it must satisfy Tn=Uk. This leads us to the equation:
Rearranging this, we get 5n=7k+6, or n=57k+6. For n to be an integer, 7k+6 must be divisible by 5.
By testing small values of k, we find that when k=2, n=514+6=4. This tells us that the 4th term of X is the same as the 2nd term of Y. Calculating this, we get 5(4)−4=16. Indeed, 16 is the first common term!
The Rhythm of the Intersection
Because the common difference of X is 5 and the common difference of Y is 7, the common terms will repeat at intervals of LCM(5,7)=35. This means the common terms themselves form an arithmetic progression with a common difference of 35.
Since the original sequence Y has a common difference of 7, the index k must increase by 35/7=5 for each subsequent common term. Thus, the indices k that yield common terms follow the sequence 2,7,12,…, which can be written as k=2+(r−1)5, where r is the number of common terms.
The Final Boundary
We must ensure these common terms do not exceed the 2018 terms provided. We have two constraints: n≤2018 and k≤2018. Using our relation n=57k+6, the constraint n≤2018 implies:
57k+6≤2018⇒7k+6≤10090⇒7k≤10084⇒k≤1440.57
Since k must be an integer, k≤1440. Now, we substitute our expression for k into this inequality:
2+(r−1)5≤1440⇒(r−1)5≤1438⇒r−1≤287.6⇒r≤288.6
Thus, there are exactly r=288 common terms. Finally, we return to our inclusion-exclusion formula:
n(X∪Y)=2018+2018−288=3748
We have navigated the intersection of these two progressions and arrived at the solution. The final answer is 3748.