Let be the set consisting of the first terms of the arithmetic progression , and be the set consisting of the first terms of the arithmetic progression . Then the number of elements in the set is _____.
Solution
Core idea. The shared terms form a bounded progression; count them before applying inclusion and exclusion.
Concept refresher. An arithmetic progression with first term a and common difference d has nth term
The first term uses zero steps, so the two thousand eighteenth term uses two thousand seventeen steps. Positive differences make all terms distinct. For finite sets, inclusion and exclusion gives
Adding the two set sizes counts a value in the overlap twice, although the union contains it once. Subtract the number of shared values, not their sum. Shared terms of these two integer progressions repeat after a multiple of both step sizes; the smallest positive such step is their least common multiple.
Picture the situation. Think of two finite lists. One advances by five and stops earlier in value; the other advances by seven and reaches farther. The common values form a third progression. The diagram first shows the two lists, then the shared progression and its cutoff. Its overlapping circles contain counts: each outside region is exclusive to one set, while the middle region is counted once in the union. The rows are schematic lists, not a common scaled number line.
Approach. Find the first and last possible shared values, count the resulting finite progression, and subtract that count once from the sum of the two set sizes. Keep both original term limits throughout.
Step 1: Write the finite sets and their bounds
Use zero-based integer indices for the two lists:
Both sets have two thousand eighteen elements. Their largest values are
A common value must therefore be at most the smaller endpoint, ten thousand eighty-six, and must also satisfy both progression congruences. The smaller endpoint itself need not be common; it only sets the upper bound. We are counting distinct values, so equal values from different lists must eventually be merged.
Step 2: Identify every common term
Equate a term from each progression:
Thus
Reducing modulo seven gives a residue of three for a, because five times three is congruent to one modulo seven. All integer solutions can be written as
Substitution gives the common values
The smallest permitted index is zero; a negative k would make both original indices negative. The first common term is sixteen, and successive common terms differ by thirty-five, the least common multiple of five and seven. Conversely, every nonnegative k satisfying both upper bounds produces a value in both sets, so no other shared progression has been omitted.
Step 3: Enforce both finite limits and count
The bound from X gives
The bound from Y allows k up to four hundred three, which is looser. Therefore the allowed common-term indices run from zero through two hundred eighty-seven, inclusive:
The last common value is
It has original indices a equal to two thousand twelve and b equal to one thousand four hundred thirty-six, so it lies in both finite lists. The next candidate is ten thousand ninety-six. Although it still lies in Y, it would require a equal to two thousand nineteen and exceeds X's endpoint. Exclude it. This endpoint check confirms that there are two hundred eighty-eight terms, rather than merely two hundred eighty-seven steps.
Step 4: Count the union without duplication
The sum of the original set sizes is four thousand thirty-six. It includes each shared value once from X and once from Y. Removing one copy of each of the two hundred eighty-eight shared values leaves exactly one occurrence of every value in the union:
Equivalently, each exclusive region has two thousand eighteen minus two hundred eighty-eight, or one thousand seven hundred thirty elements. The disjoint regions contain one thousand seven hundred thirty, two hundred eighty-eight and one thousand seven hundred thirty elements. Adding those three counts gives the same union size.
Answer. 3748
Sanity check. The union is larger than either original set and smaller than their sum, as there is a nonempty overlap. The first common value sixteen lies in both lists, the last common value ten thousand sixty-one remains below the shorter endpoint, and the next common candidate exceeds it. None of these checks requires adding the numerical values of the progression terms.
Smart method. Count matching indices of X. Its values belong to Y precisely when a has residue three modulo seven, with a from zero through two thousand seventeen. Split these indices into two hundred eighty-eight complete blocks of seven and the final two indices. Every full block contributes one matching index. The two leftovers have residues zero and one, so contribute none. All matching X values lie between sixteen and ten thousand sixty-one and hence inside Y's finite range. The overlap has two hundred eighty-eight elements; subtract it once from four thousand thirty-six to obtain three thousand seven hundred forty-eight.
This block shortcut is safe only after the first matching residue and both finite ranges are checked. Dividing an arbitrary term count by seven and rounding without checking the starting residue can change the count by one.
Common wrong answers
- 4036: Adding counts every shared value twice. The union contains each value once, so subtract the overlap count, which is two hundred eighty-eight.
- 3749: Using only two hundred eighty-seven common terms gives . The common-term index starts at zero and ends at two hundred eighty-seven, so it has two hundred eighty-eight values.
- 3632: Using only the longer progression gives indices from zero through four hundred three, or four hundred four common candidates, and . Many of these lie beyond the shorter progression; both finite bounds must hold.
Key takeaway
The trap. Using the longer cutoff, omitting the first shared term, or adding term values instead of counting elements.
How toppers think. They check the last included common value and the first excluded candidate.
Remember. Count both endpoints of the intersection progression and subtract its cardinality once.
More on Arithmetic Progression
- The sides of a right angled triangle are in arithmetic progression. If the triangle has area 24, then what…
- Suppose that all the terms of an arithmetic progression (A.P.) are natural numbers. If the ratio of the sum…
- A pack contains n cards numbered from 1 to n. Two consecutive numbered cards are removed from the pack and…
- All 9 on Arithmetic Progression ›