Let be a subset of such that the following two conditions hold:
- If and are distinct elements of , then
- If and are distinct odd elements of , then
What is the maximum possible number of elements in ?
- A)
- B)
- C)
- D)
- E)
Answer
C
Key insight
Ten numbers in a row hold at most 3 members; four would force two odd members 6 apart. The pattern 1, 4, 8 in each ten reaches 608.
Solution
Start small to see what goes wrong. The simplest idea is to take every third number: . But and are both odd and only apart, which breaks the second rule. So we cannot pack members every steps for long. The question is how often we can.
This is a "maximum" question, so it has two halves.
Part 1: no stretch of numbers in a row holds more than members.
- Take any numbers in a row, from to . Members must be at least apart.
- Could members fit? The first and the last would be at least apart, and the stretch is only long. So the only way is exactly .
- But and are both odd or both even, and so are and . One of and is odd. So one of these pairs is two odd members only apart. Not allowed.
- So each block of numbers in a row holds at most members.
- Cut to into blocks of ten ( to , to , and so on up to to ) plus the leftover . The leftover four numbers can hold at most members (they must be apart). So there are at most members.
Part 2: members is possible.
- In each block of ten, take the numbers ending in , and : that is . Then add and .
- Check rule 1: the gaps go and at the end are gaps of . Every gap is more than .
- Check rule 2: the only odd members are the ones ending in : . They are apart, which is more than .
- Count: blocks with each, plus , is .
At most and exactly is possible, so the maximum is .
The answer is .
Why this works
For "spread out as many as possible" problems, find a short stretch and ask how many members fit in it; that gives a limit you can repeat across the whole range. Try a few lengths until the rules really start to bite, which here happens at . Then show a repeating pattern that meets the limit, and handle the leftover numbers at the end separately.
The trap
Using 1, 4, 7, 10, ... (odd members only 6 apart, not allowed), or only even numbers spaced 4 apart (506), or forgetting the 2 extra members from 2021 to 2024.
Concise solution
Upper bound. Take any consecutive integers. Elements of are pairwise at least apart, so at most of them lie in this stretch, and is possible only if they are . But then share a parity and so do ; one of these pairs consists of two odd elements only apart, contradicting the second condition. So every consecutive integers contain at most elements of .
Cut into blocks of ten (–, …, –) plus the leftover , which holds at most elements (they must be apart). Hence .
Construction. In each block take for , and add and . Consecutive elements differ by and finally by , so all gaps exceed . The odd elements are exactly , spaced apart, which exceeds . This has elements.
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 1: Integers: The Basics
- Introduction to Counting & Probability, Chapter 1: Counting Is Arithmetic
- Prealgebra, Chapter 15: Problem-Solving Strategies (§15.1)
- Introduction to Algebra, Chapter 20: Special Functions (§20.3)
Techniques
Bound the quantity above/below or estimate to pin it down · Use an invariant, parity, or coloring argument · Compute small cases, spot the pattern, generalize