Let $x_0, x_1, \dots , x_{n_0-1}$ be integers, and let $d_1, d_2, \dots, d_k$ be positive integers with $n_0 = d_1 > d_2 > \cdots > d_k$ and $\gcd (d_1, d_2, \dots , d_k) = 1$. For every integer $n \ge n_0$, define \[ x_n = \left\lfloor{\frac{x_{n-d_1} + x_{n-d_2} + \cdots + x_{n-d_k}}{k}}\right\rfloor. \] Show that the sequence $\{x_n\}$ is eventually constant.
Problem
Source: USA TSTST 2011/2012 P8
Tags: floor function, number theory
27.07.2011 06:44
08.04.2012 16:57
Can you explain in more detail why the sequence must be periodic? That doesn't seem very clear to me.
30.12.2013 06:08
By CRT, there exists an $r$ such that for all $y \ge r$, there exist $a_1,\cdots a_{k}$ such that $\displaystyle y = \sum_{i=0}^{k} a_i d_i$, since $\gcd(d_1, \cdots, d_k) = 1$. Clearly the sequence is bounded below by the minimum of $x_0, \cdots x_{n_0-1}$, and above by the maximum of $x_0, \cdots x_{n_0-1}$. Thus there are a finite number of values in the sequence, so there exists a largest number that appears infinitely many times. Let this value be $a$. Since the sequence is bounded, and $a$ is the largest number that appears infinitely many times, after some point all values will be at most $a$, so we can WLOG that the sequence starts here, so $x_i \le a$ for all $i$. Lemma: If $q \ge n_0$, then $x_{q} = a$ implies $x_{q-d_i}=a$ for any $i$. Proof: $\displaystyle a = x_{q} = \left \lfloor \frac{x_{q-d_1}+x_{q-d_2}+\cdots+x_{q-d_n}}{k} \right \rfloor \le \frac{x_{q-d_1}+x_{q-d_2}+\cdots+x_{q-d_n}}{k} \le \frac{ka}{k} = a$. Thus $x_{q-d_1} = x_{q-d_2} = \cdots = x_{q-d_n} = a$, implying the result. Now, take an $m$ such that $x_m=a$ and $m \ge r+n_0-1+n_0$, which exists because $a$ appears infinitely many times. By our fact in the beginning, for each $r \le y \le r+n_0-1$, $m-y$ is a integer combination of the $d_i$. Using the lemma, we have that for each of these $r$, $x_{m-r}=a$, so for all $n_0 \le z \le 2n_0-1$, we have that $x_z = a$. Now, it is clear that for all $z \ge 2n_0$, we have that $x_z=a$, so the sequence $x$ becomes constant.
23.09.2017 02:19
Let $u = \min(x_0, \dots, x_{n_0 - 1})$ and $v = \max(x_0, \dots, x_{n_0 - 1})$. By an easy induction, every term of the sequence is in $[u, v]$, and in particular, since each term only depends on the $n_0$ terms preceding it, the sequence is eventually periodic with period $p$, say. WLOG we may assume that, by deleting some initial terms, that the sequence is (purely) periodic; then, consider all indices modulo $p$. Let $w = \max(x_0, \dots, x_{p - 1})$, and suppose $x_m = w$. Then \[w = x_m = \left\lfloor{\frac{x_{m - d_1} + \cdots + x_{m - d_k}}{k}}\right\rfloor \implies x_{m - d_1} + \dots + x_{m - d_k} \ge wk.\]Thus, $x_{m - d_1} = \dots = x_{m - d_k} = w$ as well. It follows that for any nonnegative integers $a_1, \dots, a_k$, \[x_{m - a_1d_1 - \dots - a_kd_k} = w.\]However, since the index is taken modulo $p$, we may allow the $a_i$ to be negative (as we can shift $a_i \to a_i + \lambda p$ for a large positive integer $\lambda$). By Bezout, we may select $a_1, \dots, a_k$ such that $a_1d_1 + \dots + a_kd_k = 1$, giving $x_m = w \implies x_{m - 1} = w$. Proceeding in this fashion, the sequence is a constant sequence $w$.
06.06.2019 03:45
Solution found with Luke Robitaille. We prove that if $M$ is the maximum of $x_i$ for $i\in[kn_0,(k+1)n_0-1]$, then the number of times it appears in $I_k=[kn_0,(k+1)n_0-1]$ is strictly more than the number of times it appears in $I_{k+1}=[(k+1)n_0,(k+2)n_0-1]$, unless all of $I_k$ is $M$ (for large enough $k$). This would finish as by the recurrence, $x_i$ for $i\in I_{k+1}$ is clearly at most $M$, so eventually all of $I_k$ is $M$, and we're done. Suppose $M$ appears equally as many times in $I_k$ as $I_{k+1}$. Note that if $n\in I_{k+1}$ and $x_n=M$, then we must have $x_{n-d_j}=M$ for all $j\in[k]$. Call an index $i$ maximal if $x_i=M$, so we have $i$ maximal implies $i-d_j$ maximal as long as $i-d_1=i-n_0$ is non-negative, which isn't a problem for sufficiently large $k$. Thus, since the number of maximal indices in $I_k$ and $I_{k+1}=I_k+d_1=I_k+n_0$ is the same, we in fact have that the maximal indices in $I_{k+1}$ are just the maximal indices in $I_k$ plus $n_0$. Looking at the maximal indices mod $n_0$, we see that $i$ maximal implies $i-d_j$ is maximal, and since $\gcd(d_1,\ldots,d_k)=1$, by Bezout we see that all numbers mod $n_0$ have some realization that's maximal. However, this implies that every element of $I_k$ is maximal, so we're in fact done.
17.12.2019 02:16
Note that $(x_i+c)$ works as well, so let's assume $x_i>0$ for all $i$. Claim 1. $(x_i)$ is bounded. Proof: Suppose otherwise. Then there exists $j \ge d_1$ such that $x_j >x_i$ for all $i<j$, so $x_j>\frac{x_{j-d_1}+\ldots+x_{j-d_k}}{k}$, a contradiction. Claim 2. There exists an infinite set $T$ such that for $i, j \in T$ we have $x_i=x_j$ and $i-d_1, i-d_2, \ldots, i-d_k \in T$ if $i-d_1> \text{min} T$. Proof: Note that $(x_{d_1+i})$ has a maximum $x_{t_1}$. Now $(x_{t_1+d_1+i})$ also has a maximum $x_{t_2}$. Proceeding this way, we get an infinite sequence $(x_{t_i})$ which is monotonic and non-increasing, thus eventually constant, say $(x_{t_{N+i}})$ is constant. So for $i>N$ we have $x_{t_i} \ge x_{t_i-d_j}$ for all $j$, hence $x_{t_i}=x_{t_i-d_j}$. So it suffices to take $T=\{t_{N+d_1+2}, t_{N+d_1+3}, \ldots \}$ because for $t \in T$ we have $t-d_j \ge t_{N+1}$ and $x_{t-d_j}$ is a maximum in $(x_{t_{N+1}+i})$. Now consider $x>\text{min} T$. We know that there exists $K$ such that every integer greater than $K$ can be written as $l_1d_1+ \ldots +l_kd_k$ for integers $l_j \ge 0$. Take $t_p>x+K$ and $t_p-x= l_1d_1+ \ldots +l_kd_k$. Then by claim 2, $t_p-(l_1d_1+ \ldots +l_kd_k) \in T$, then $x \in T$. Then $T=\mathbb{N} \cap [\text{min} T, +\infty)$ and the result follows.
21.12.2021 13:31
For any $i \ge 0$ let set $S_i = \{i,i+1,\ldots,i+n_0 -1 \}$. Observe that \begin{align} \max(S_i) \ge \max(S_{i+1}) ~~ \forall ~ i \ge 0 \end{align}Claim: If all terms of some $S_j$ are not equal, then $\exists ~ M$ such that $\max(S_M) < \max(S_j)$. Proof: Let $d = \max(S_j)$. Using $(1)$ it follows that $x_l \le d ~ \forall ~ l \ge j$. Pick a $x_t \in S_j$ such that $x_t < \max(S_j)$. For any $a_1,a_2,\ldots,a_k \in \mathbb Z_{\ge 0}$, one can show that $$x_{t + a_1d_1 + a_2d_2 + \cdots + a_k d_k} < d$$using induction on $a_1 + a_2 + \cdots + a_k$. Now since all sufficiently large positive integers can be represented as $$t + a_1d_1 + a_2d_2 + \cdots + a_kd_k ~~ a_1,a_2,\ldots,a_k \in \mathbb Z_{\ge 0}$$(say by fixing $a_3 = a_4 = \ldots = a_k = 0$ using Chicken McNugget Theorem), so it follows that for large enough $M_0$, we have $a_{M_0} < d$, so our claim follows. $\square$ Now note that all $x_i \ge \min(S_0) ~ \forall ~ i \ge 0$, in particular the sequence $$\max(S_0),\max(S_1),\max(S_2),\ldots$$has a lower bound. Moreover, by $(1)$ we know it is non-increasing. Thus, it will eventually stabilize. Then by using our Claim, the problem follows. $\blacksquare$
10.06.2023 20:14
A good problem. Also my first post. Note that the maximal number of the sequence (in a contained period) is eventually decreasing, and since there is no infinitely decreasing sequence on positive integers, it is eventually constant. Let this constant be $M$. Similar relation can be shown for the minimal number, we have it is increasing, but it can't get greater than the maximal number, so it is also eventually constant. Now I claim that the sequence is eventually periodic. Since the sequence is bounded, we can find two arbitrarily large chunks (continuous) of the sequence that are equal to each other. Note that then the average would repeat again and again, thus meaning the sequence is eventually periodic. Let the period be $T$. Note that we can get linear combinations of $d_{i}$ (the coefficients being positive integers) such that they are a complete residue set mod $T$. Now take a large enough $N$ such that $x_{N} = M$, now just subtract these linear combinations to get anything mod $T$ is eventually just $M$, so we're done.
26.11.2023 13:25
Note that $\operatorname{min}_{i=0}^{n_0-1} x_i \leq x_k \leq \operatorname{max}_{j=0}^{n_0-1} x_j$, hence $\{x_n\}$ is bounded and thus eventually periodic. Let this period be $T$, and say the maximal element in $\{x_n\}$ is $M$. This implies that for $x_n = M$ that $x_{n+d_i} = M$ for any $d_i$. On the other hand, there always exists constants $a_i$ such that $N = \sum a_id_i \equiv 1 \pmod T$ (say, by Bezout then a suitable shift), so it follows that $M = a_n = a_{N+n} = a_{n+1}$. Then $a_i = M$ for all $i \geq n$.
15.03.2024 22:24
Suppose $x_0,x_1,\ldots,x_{n_0-1}$ are bounded by some interval $[A,B]$ where $A,B$ are integers. We claim using strong induction that $x_n\in[A,B]$. Clearly the base case works. For induction step, simple note that \[\frac{Ak}{k}=A\leq \lfloor\frac{x_{n-d_1}+x_{n-d_2}+\cdots+x_{n-d_k}}{k}\rfloor\leq\frac{Bk}{k}=B\]Hence, the sequence $(x_n)$ is eventually periodic with some period $P$. Since it is bounded, there exists a maximal element $M$. Note that $x_n=M$ then \[M=\lfloor\frac{x_{n-d_1}+x_{n-d_2}+\cdots+x_{n-d_k}}{k}\rfloor\leq \frac{x_{n-d_1}+x_{n-d_2}+\cdots+x_{n-d_k}}{k} = M,\]which forces $x_{n-d_i}=M$ for each $i$. Since $\gcd(d_1,d_2,\ldots,d_k)=1$, from Bezout's theorem, we can conjure up coefficients $a_1,a_2,\ldots,a_k$ such that $a_1d_1+a_2d_2+\cdots+a_kd_k=1$. Now, if $a_i>0$ then replace $a_i$ with $a_i-P$. In this way, we get the $\text{sum}\equiv1\pmod{P}$. Take sufficiently large $n$ such that $x_n=M$. Then, $x_{n-1}=M$ as well. Hence, $x_n$ is eventually constant. $\blacksquare$