A sequence with first two terms equal and respectively is defined by the following rule: each subsequent term is equal to the smallest positive integer which has not yet occurred in the sequence and is not coprime with the previous term. Prove that all positive integers occur in this sequence.
Solution
1. Define the sequence and sets:
Let denote the terms in the sequence, with and . Define the set as the set of the first terms of the sequence, and as the set of all terms that eventually appear in the sequence. Let be the set of positive integers that never appear in the sequence.
2. **Assume :**
Suppose not all positive integers occur in the sequence, i.e., .
3. **Composite numbers in :**
- Assume is a composite number. By the Well-Ordering Principle (WOP), we can assume is the smallest composite number in .
- Consider the set .
- Since is composite, it has at least one prime factor. Therefore, there exists some with maximal (the last number having a common factor with to appear in the sequence).
- By the sequence's rule, the next term should be the smallest positive integer not yet in the sequence and not coprime with . Since and share a common factor, should be , implying , which is a contradiction. Therefore, cannot contain any composite number.
4. **Prime numbers in :**
- Let be the smallest prime number in (using WOP again). Note that because .
- Since is a composite number, and we have already shown that cannot contain any composite numbers, . Thus, there exists some such that .
- By the sequence's rule, the next term should be the smallest positive integer not yet in the sequence and not coprime with . Since and share a common factor, should be , implying , which is a contradiction. Therefore, cannot contain any prime number.
5. Conclusion:
- Since cannot contain any composite numbers or prime numbers, and , we conclude that .
- Therefore, , meaning all positive integers occur in the sequence.