Let be an infinite sequence of positive integers, and let be a positive integer. 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.
(An infinite sequence is eventually periodic if there exist positive integers and such that for all .)
Solution
Denote the number of occurrences of among the first entries of the sequence. We have for all . Select a sufficiently large integer such that for all and for all .
We begin by observing that starting from , any pairs will appear only once in the sequence. It means that all the numbers that precedents a same number in the sequence must be mutually different.
Claim 1: For all and ,. Proof
Claim 2: for all . Proof
Due to claim 1 and claim 2, for all and , we have . This means that for any given , converges to for some (due to monotonicity in ). Due to claim 1 again we can see that for all , so for some . Hence, there exists constants such that for all .
Claim 3: and the numbers are the only numbers that occur infinitely often in the sequence. Proof
Claim 3 implies that there exists sufficiently large integers and such that for all , it is either that , or . Note that we can again select to be large enough so that for all , so that any numbers that comes after must be larger than . This creates an alternating sequence between "large" and "small" number. It is sufficient to show that the sequence of "small" number is eventually periodic. The tricky part of this is to control the gap between occurrences of the same number.
Claim 4: There exists a constant such that for any ,. Proof
For a number , define the indices that . Denote the difference tuple .
Claim 5: There is a constant such that for all and . Proof
Now, since there are at most values for the tuples for , must be eventually periodic. Let be the period of , and let , then for every sufficiently large and , we have . Now, we can proceed similar to claim 5 to show that there is a constant such that for all (brief idea: the difference is the difference between the 1 and 1, hence occurrences of can only be at most for each of them). This again means that is eventually periodic, so there is a period such that for all sufficiently large.
It is important to note that eventual periodicity is implied due to a non trivial fact that once a pattern repeats, then by induction it will keep repeating. I'll leave this as some details for others to work on.
Let . Then for any sufficiently large and . This implies that the "small" sequence is eventually periodic, as desired.