Browse · MathNet
PrintIMO2024 Shortlisted Problems
2024 algebra
Problem
Let be a positive integer and let be an infinite sequence of positive integers. Suppose that, for each , is equal to the number of times appears in the list . Prove that at least one of the sequences and is eventually periodic.
Solution
Let . We first prove that some integer appears infinitely many times. If not, then the sequence contains arbitrarily large integers. The first time each integer larger than appears, it is followed by a . So appears infinitely many times, which is a contradiction.
Now we prove that every integer appears at most times. If not, consider the first time that any appears for the time. Up to this point, each appearance of is preceded by an integer which has appeared times. So there must have been at least numbers that have already appeared at least times before does, which is a contradiction.
Thus there are only finitely many numbers that appear infinitely many times. Let the largest of these be . Since appears infinitely many times there must be infinitely many integers greater than which appear at least times in the sequence, so each integer also appears infinitely many times. Since doesn't appear infinitely often there must only be finitely many numbers which appear more than times. Let the largest such number be . From here on we call an integer big if , medium if and small if . To summarise, each small number appears infinitely many times in the sequence, while each big number appears at most times in the sequence.
Choose a large enough such that is small, and in : - every medium number has already made all of its appearances; - every small number has made more than appearances.
Since every small number has appeared more than times, past this point each small number must be followed by a big number. Also, by definition each big number appears at most times, so it must be followed by a small number. Hence the sequence alternates between big and small numbers after .
Lemma 1. Let be a big number that appears after . If is followed by the small number , then equals the amount of small numbers which have appeared at least times before that point.
Proof. By the definition of , the small number immediately preceding has appeared more than times, so . And since , the appearance of every small number must occur after and hence is followed by . Since there are small numbers and appears at most times, must appear exactly times, always following a small number after . Hence on the appearance of , exactly small numbers have appeared at least times before that point.
Denote by the subsequence .
Lemma 2. Suppose that and satisfy the following conditions: (a) , (b) is small and , (c) no small value appears more than once in .
Then is equal to some small number in .
Proof. Let be the set of small numbers that appear at least times in . By Lemma 1, . Similarly, let be the set of small numbers that appear at least times in . Then by Lemma 1, and hence by (b), . Also by definition, and .
Suppose the small number is not in . This means has appeared less than times in . By (c), has appeared at most times in , hence . Combining with , this implies . But since , this contradicts . So , which means it has appeared at least times in and one more time in . Therefore .
By (c), any small number appearing at least times in has also appeared times in . So and hence . Therefore, , so it must appear at least more time in .
For each small number with , let be the smallest number such that is also small for some with . In other words, is the first small number to occur twice after . If , Lemma 2 (with ) implies that appears again before , contradicting the minimality of . So . Lemma 2 also implies that . So is a nondecreasing sequence bounded above by (as there are only small numbers). Therefore, is eventually constant and the subsequence of small numbers is eventually periodic with period at most .
---
Alternative solution.
We follow Solution 1 until after Lemma 1. For each , we keep track of how many times each of has appeared in . We will record this information in an updating -tuple where each records the number of times has appeared. The final element of the tuple, also called the active element, represents the latest small number that has appeared in .
As increases, the value of is updated whenever is small. The tuple updates deterministically based on its previous value. In particular, when is small, the active element is updated to and we increment by . The next big number is . By Lemma 1, the next value of the active element, or the next small number , is given by the number of terms greater than or equal to the newly updated , or
Each sufficiently large integer which appears times must also appear times, with both of these appearances occurring after the initial block of . So there exists a global constant such that . Suppose that for some , is unbounded from below. Since the value of changes by at most when it is updated, there must be some update where decreases and . Combining with the fact that for all , we see that at this particular point, by the triangle inequality Since just decreased, the new active element is . From this point on, if the new active element is at most , by the previous formula, the next element to increase is once again from . Thus only will increase from this point onwards, and will no longer increase, contradicting the fact that must appear infinitely often in the sequence. Therefore is bounded.
Since is bounded, it follows that each of is bounded for . This means that there are only finitely many different states for . Since the next active element is completely determined by the relative sizes of to each other, and the update of terms depends on the active element, the active element must be eventually periodic. Therefore the small numbers subsequence, which is either or , must be eventually periodic.
Now we prove that every integer appears at most times. If not, consider the first time that any appears for the time. Up to this point, each appearance of is preceded by an integer which has appeared times. So there must have been at least numbers that have already appeared at least times before does, which is a contradiction.
Thus there are only finitely many numbers that appear infinitely many times. Let the largest of these be . Since appears infinitely many times there must be infinitely many integers greater than which appear at least times in the sequence, so each integer also appears infinitely many times. Since doesn't appear infinitely often there must only be finitely many numbers which appear more than times. Let the largest such number be . From here on we call an integer big if , medium if and small if . To summarise, each small number appears infinitely many times in the sequence, while each big number appears at most times in the sequence.
Choose a large enough such that is small, and in : - every medium number has already made all of its appearances; - every small number has made more than appearances.
Since every small number has appeared more than times, past this point each small number must be followed by a big number. Also, by definition each big number appears at most times, so it must be followed by a small number. Hence the sequence alternates between big and small numbers after .
Lemma 1. Let be a big number that appears after . If is followed by the small number , then equals the amount of small numbers which have appeared at least times before that point.
Proof. By the definition of , the small number immediately preceding has appeared more than times, so . And since , the appearance of every small number must occur after and hence is followed by . Since there are small numbers and appears at most times, must appear exactly times, always following a small number after . Hence on the appearance of , exactly small numbers have appeared at least times before that point.
Denote by the subsequence .
Lemma 2. Suppose that and satisfy the following conditions: (a) , (b) is small and , (c) no small value appears more than once in .
Then is equal to some small number in .
Proof. Let be the set of small numbers that appear at least times in . By Lemma 1, . Similarly, let be the set of small numbers that appear at least times in . Then by Lemma 1, and hence by (b), . Also by definition, and .
Suppose the small number is not in . This means has appeared less than times in . By (c), has appeared at most times in , hence . Combining with , this implies . But since , this contradicts . So , which means it has appeared at least times in and one more time in . Therefore .
By (c), any small number appearing at least times in has also appeared times in . So and hence . Therefore, , so it must appear at least more time in .
For each small number with , let be the smallest number such that is also small for some with . In other words, is the first small number to occur twice after . If , Lemma 2 (with ) implies that appears again before , contradicting the minimality of . So . Lemma 2 also implies that . So is a nondecreasing sequence bounded above by (as there are only small numbers). Therefore, is eventually constant and the subsequence of small numbers is eventually periodic with period at most .
---
Alternative solution.
We follow Solution 1 until after Lemma 1. For each , we keep track of how many times each of has appeared in . We will record this information in an updating -tuple where each records the number of times has appeared. The final element of the tuple, also called the active element, represents the latest small number that has appeared in .
As increases, the value of is updated whenever is small. The tuple updates deterministically based on its previous value. In particular, when is small, the active element is updated to and we increment by . The next big number is . By Lemma 1, the next value of the active element, or the next small number , is given by the number of terms greater than or equal to the newly updated , or
Each sufficiently large integer which appears times must also appear times, with both of these appearances occurring after the initial block of . So there exists a global constant such that . Suppose that for some , is unbounded from below. Since the value of changes by at most when it is updated, there must be some update where decreases and . Combining with the fact that for all , we see that at this particular point, by the triangle inequality Since just decreased, the new active element is . From this point on, if the new active element is at most , by the previous formula, the next element to increase is once again from . Thus only will increase from this point onwards, and will no longer increase, contradicting the fact that must appear infinitely often in the sequence. Therefore is bounded.
Since is bounded, it follows that each of is bounded for . This means that there are only finitely many different states for . Since the next active element is completely determined by the relative sizes of to each other, and the update of terms depends on the active element, the active element must be eventually periodic. Therefore the small numbers subsequence, which is either or , must be eventually periodic.
Techniques
Recurrence relationsInvariants / monovariantsCounting two ways