Let $a_1,a_2,\dots,a_{2023}$ be positive integers such that $a_1,a_2,\dots,a_{2023}$ is a permutation of $1,2,\dots,2023$, and $|a_1-a_2|,|a_2-a_3|,\dots,|a_{2022}-a_{2023}|$ is a permutation of $1,2,\dots,2022$. Prove that $\max(a_1,a_{2023})\ge 507$.
Problem
Source: ISL 2023 A5
Tags: inequalities, AZE BMO TST, TST, IMO Shortlist
17.07.2024 15:08
Call $a_i$ big if $a_i>a_{i-1}$ and $a_i>a_{i+1},$ and call $a_i$ small if $a_i<a_{i-1}$ and $a_i<a_{i+1}.$ Now suppose $a_1,a_{2023}$ are small. Then we have \[2\left(\sum_{a_i\text{ big}}a_i-\sum_{a_i\text{ small}}a_i\right)+a_1+a_{2023}=\sum_{i=1}^{2022}|a_i-a_{i+1}|=1+2+3+\dots+2022,\]since big $a_i$ are counted twice, small $a_i$ are counted $-2$ times except for $a_1,a_{2023}$ which are counted only $-1$ times, and everything else is counted $0$ times. The next observation is that there is exactly one more small $a_i$ than big $a_i,$ since across all $i,$ the average $a_i$ is counted exactly $0$ times, and this one extra $a_i$ makes up for the two small $a_i$ only counted $-1$ times. Now we want to maximize \[\sum_{a_i\text{ big}}a_i-\sum_{a_i\text{ small}}a_i,\]which we do by making big $a_i$ as big as possible and small $a_i$ as small as possible, and by adding more to each set until no more can be added. This gives the maximum, and the bound \[\sum_{a_i\text{ big}}a_i-\sum_{a_i\text{ small}}a_i\le(1013+1014+\dots+2023)-(1+2+\dots+1012)=1011^2-1.\]Thus we have \[a_1+a_{2023}=1011\cdot 2023-2\left(\sum_{a_i\text{ big}}a_i-\sum_{a_i\text{ small}}a_i\right)\ge 1011\cdot 2023-2(1011^2-1)=1013,\]so $\max(a_1,a_{2023})\ge 507.$ Now suppose $a_{2023}$ is still small, but $a_1$ is big. Let $k$ be the smallest positive integer for which $a_k$ is small. By assumption, all $a_i$ between $a_1$ and $a_k$ are neither big nor small. Now say $a_i$ is big' if $a_i$ is big and $i\ne 1.$ We get \[2\left(\sum_{a_i\text{ big'}}a_i-\sum_{a_i\text{ small}}a_i\right)+a_k+a_{2023}=1+2+3+\dots+2022+a_k-a_1,\]since $a_k-a_1$ is the negative of the sum of the skipped differences $a_1-a_2+a_2-a_3+\dots+a_{k-1}-a_k.$ But for the same reason as before there is one more small $a_i$ than big' $a_i.$ Thus we still have \[\sum_{a_i\text{ big'}}a_i-\sum_{a_i\text{ small}}a_i\le 1011^2-1\]for the same reason as before, since the $a_i$ are still from $1$ to $2023,$ so we still have $a_1+a_{2023}\ge 1013$ and $\max(a_1,a_{2023})\ge 507.$ Now $a_1$ small and $a_{2023}$ big is the same as the previous case. Thus we consider $a_1,a_{2023}$ both big. Define $k$ as before, and define $j$ to be the largest positive integer $<2023$ for which $a_j$ is small. Define big' as before, and define small' similarly. Now we have \[2\left(\sum_{a_i\text{ big'}}a_i-\sum_{a_i\text{ small'}}a_i\right)+a_k+a_j=1+2+3+\dots+2022+a_k-a_1+a_j-a_{2023},\]after accounting for the skipped differences. But there is still one more small' $a_i$ than big' $a_i.$ Thus the same thing holds here, and we still have $\max(a_1,a_{2023})\ge 507.$ These are all cases, so we are done. Remark. The bound $507$ is tight, due to the following construction: \[a_n=\begin{cases}\frac{1013-n}2&1\le n\le 1011,n\equiv 1\pmod 2\\\frac{3037-n}2&1013\le n\le 2023,n\equiv 1\pmod 2\\\frac n2+1517&2\le n\le 1012,n\equiv 0\pmod 2\\\frac n2+506&1014\le n\le 2022,n\equiv 0\pmod 2\end{cases}\]
17.07.2024 15:20
Let $n = 506$ and assume $a_1$, $a_{4n-1} \leq n$. Then \begin{align*} &\quad \quad (2n-1)(4n-1) = \sum_{i=1}^{4n-2} \lvert a_i - a_{i+1} \rvert \leq -\lvert 2n-a_1 \rvert - \lvert 2n - a_{4n-1} \rvert + 2\sum_{i=1}^{4n-1} \lvert 2n - a_i \rvert \\ &\implies 2n \leq \lvert 2n - a_1 \rvert + \lvert 2n - a_{4n-1} \rvert \leq (2n-1)4n - (2n-1)(4n-1), \ \text{contradiction.} \end{align*}
17.07.2024 15:22
Here's the solution I found during TST. Let $b_i=a_i-1012$. Now notice that by triangle inequality, $|a_1-a_2|+|a_2-a_3|+...+|a_{2022}-a_{2023}| = |b_1-b_2|+|b_2-b_3|+...+|b_{2022}-b_{2023}| \leq 2(|b_1|+|b_2|+...+|b_{2023}|)-|b_1|-|b_{2023}| = 2024*1011-|b_1|-|b_{2023}|$ Since $|a_1-a_2|+|a_2-a_3|+...+|a_{2022}-a_{2023}| = 1011*2023$, we have $1011*2023+|b_1|+|b_{2023}| \leq 1011*2024$ $|b_1|+|b_{2023}| \leq 1011$ If at least one of $b_1$ and $b_{2023}$ is positive, then we are done. Otherwise, notice that $|b_1|$ or $|b_{2023}|$ $\leq 505$. But adding back, this shows that max$(a_1, a_{2023}) \geq -505+1012=507$. Done!
17.07.2024 15:34
Isn't it just Vietnam MO 2001 problem 6 https://artofproblemsolving.com/community/c6h139399p788942 https://artofproblemsolving.com/community/q1h72654p420744
17.07.2024 15:50
Solved with KevinYang2.71. A construction to attain $507$ is \begin{align*} 506, 1518, 505, 1519, 504, 1520, ..., 1, 2023 \\ 1012, 1013, 1011, 1014, 1010, ..., 1517, 507 \\ \end{align*}Now we prove the bound, in particular that $a_1 + a_{2023} \ge 1013$. Suppose otherwise. Define $a_0 = 0, a_{2024} = 0$, and for each $i \in \{1, 2, \ldots, 2023\}$, $a_i$ is a peak iff $a_i > a_{i+1}$ and $a_i > a_{i-1}$, a valley if $a_i < a_{i+1}$ and $a_i < a_{i-1}$ and stable otherwise. Let $p$ be the sum of the peaks, $s$ be the sum of the stables, and $v$ be the sum of the valleys. Clearly we have $p + s + v = 1 + 2 + \cdots + 2023$, so $2p + 2s + 2v = 2(1 + 2 + \cdots + 2023)$ . Then in the sum of $|a_i - a_{i+1}|$ over $0 \le i \le 2023$, we have that every stable is subtracted and added once, every peak is added twice and every valley is subtracted twice, but this sum must also equal $1 + 2 + \cdots + 2022 + a_1 + a_{2023}$, so $2p - 2v = 1 + 2 + \cdots + 2022 + a_1 + a_{2023}$. Now we subtract the equations and get \begin{align*} 2s + 4v = 1 + 2 + \cdots + 2022 + 4046 - a_1 - a_{2023} \\ = 1013 \cdot 2023 - (a_1 + a_{2023}) = 1013 \cdot 2024 - 1013 - (a_1 + a_{2023}) \\ < 1013 \cdot 2024 - 2(a_1 + a_{2023}) = 4(1 + 2 + \cdots + 1012) - 2(a_1 + a_{2023}).\\ \end{align*}Dividing both sides by $2$ gives that $s + 2v < 2(1 + 2 + \cdots + 1012) - (a_1 + a_{2023})$, so $s + 2v + a_1 + a_{2023} < 2(1 + 2 + \cdots + 1012)$. However, $\text{min}(a_i, a_{i+1})$ for $i = 1$ to $i = 2022$ counts each stable once and each valley twice, so $s + 2v = \sum_{i=1}^{2022} \text{min}(a_i, a_{i+1})$, no three of these mins are equal, and only at most one of them equals $a_1$ and same thing with $a_{2023}$, so $s + 2v + a_1 + a_{2023}$ is the sum of $2024$ positive integers where no three are equal, so they add up to at least $2(1 + 2 + \cdots + 1012)$, contradiction. Thus, $a_1 + a_{2023} \ge 1013$, proving $\text{max}(a_1, a_{2023}) \ge 507$.
17.07.2024 17:21
First, $\max \{x, y \} = \frac{x + y - |x - y|}{2}$. $(*)$ Let $s = \sum_{i=1}^{2022} \max \{ a_i, a_{i+1} \}$. Using $(*)$, we get $s = \sum_{i=1}^{2022} \frac{a_i + a_{i+1} - |a_i - a_{i+1}|}{2}$. Now, we use the second condition to get that $s = 1 + 2 + \dots + 2023 - \frac{a_1 + a_{2023}}{2} - \frac{1 + 2 + \dots 2022}{2} = 2023 \cdot 1012 - \frac{a_1 + a_{2023}}{2} - \frac{2023 \cdot 1011}{2}$. Now, also $s$ has $2022$ summands, and each appears at most $2$ times. Thus, $s \geq 2(1 + 2 + \dots 1012) - a_1 - a_{2023} = 1012 \cdot 1013 - a_1 - a_{2023}$. Thus, we get $2023 \cdot 1012 - \frac{a_1 + a_{2023}}{2} - \frac{2023 \cdot 1011}{2} \geq 1012 \cdot 1013 - a_1 - a_{2023} \iff a_1 + a_{2023} \geq 1013$. Thus, we get that $\max(a_1,a_{2023}) \geq 507$.
17.07.2024 17:31
Here is maybe the most motivated solution. One way to get rid of absolute value is by the formula $$|a-b|=a+b-2\min(a,b).$$Thus, \begin{align*} &1011\cdot 2023\\ &=\sum_{i=1}^{2022}i\\ &=\sum_{i=1}^{2022}|a_i-a_{i+1}|\\ &=\sum_{i=1}^{2022}(a_i+a_{i+1}-2\min(a_i,a_{i+1}))\\ &=2\sum_{i=1}^{2023}a_i-a_1-a_{2023}-2\sum_{i=1}^{2022}\min(a_i,a_{i+1})\\ &=2023\cdot 2024-a_1-a_{2023}-2\sum_{i=1}^{2022}\min(a_i,a_{i+1}). \end{align*}Hence, $$a_1+a_{2023}=2\left(a_1+a_{2023}+\sum_{i=1}^{2022}\min(a_i,a_{i+1})\right)-1013\cdot 2023.$$Note that in the sum $$s\doteqdot a_1+a_{2023}+\sum_{i=1}^{2022}\min(a_i,a_{i+1})$$each $a_i$ is counted at most twice, so $$s\ge 2\sum_{i=1}^{1012}i=1012\cdot 1013.$$Therefore, $$a_1+a_{2023}\ge 2\cdot 1012\cdot 1013-1013\cdot 2023=1013.$$Hence $a_1+a_{2023}\ge 1013$ so $\max(a_1,a_{2023})\ge 507$.
19.07.2024 16:43
Sum all ,we obtain a explicit proof ,actually I’ve seen questions much sophisticated than this
21.07.2024 03:20
29.07.2024 09:35
The answer is $507$. In general, if $2023$ is replaced by $4k+3$ for an integer $k \ge 0$, the answer $k+2$. Construction. The following construction for $k=5$ (i.e.\ of $\{1,2,\dots,23\}$) generalizes ready to any $n = 4k+3$. [asy][asy] size(14cm); int x[] = {7, 17, 8, 16, 9, 15, 10, 14, 11, 13, 12, 23, 1, 22, 2, 21, 3, 20, 4, 19, 5, 18, 6}; pair P(int i) { return (i,x[i]); } dotfactor *= 1.5; for (int i=0; i<x.length-1; ++i) { draw(P(i)--P(i+1), red); label((string)abs(x[i+1]-x[i]), midpoint(P(i)--P(i+1)), black+fontsize(11pt)); } for (int i=0; i<x.length; ++i) { dot("$"+(string)x[i]+"$", P(i), dir(180*i-90), mediumred+fontsize(13pt)); } [/asy][/asy] To be explicit, for $2023$ the permutation is \[ (507,1517,508,1516,\dots,1012,2023,1,2022,2,\dots,506). \] Proof of bound. We will prove more strongly that \[ a_1 + a_{2023} \ge 1013 \qquad (*) \]which will certainly imply $\min(a_1, a_{2023}) \ge 507$. The proof is completely global: the idea is that $\sum |a_i-a_{i+1}|$ is rarely large enough. Indeed, write \begin{align*} 1+2+\dots+2022 &= \sum_{i=1}^{2022} |a_i - a_{i+1}| \\ &= \sum_{i=1}^{2022} \left( a_i + a_{i+1} - 2\min(a_i, a_{i+1}) \right) \\ &= \left( a_1 + 2a_2 + 2a_3 + \dots + 2a_{2022} + a_{2023} \right) - 2 \sum_{i=1}^{2022} \min(a_i, a_{i+1}) \\ &= 2(1+2+\dots+2023) - (a_1 + a_{2023}) - 2 \sum_{i=1}^{2022} \min(a_i, a_{i+1}). \end{align*}To estimate a lower bound for \[ S \coloneqq \sum_{i=1}^{2022} \min(a_i, a_{i+1}) \]the simplest bound is to observe that every $a_i$ can appear at most twice as a minimum, so we certainly have $S \ge 1+1+2+2+\dots+1011+1011 = 2(1+2+\dots+1011)$. However, we can refine the bound as follows. Assume for contradiction that $a_1 + a_{2023} \le 1012$, then it follows that both $a_1$ and $a_{2023}$ are at most $1011$, and those terms can thus appear at most once in $S$ rather than twice (or zero times if $a_1 = a_{2023}$). So in fact we have \[ S \ge 2(1+2+\dots+1012) - (a_1 + a_{2023}). \]Put this all together to get \[ 1+2+\dots+2022 \le 2(1+2+\dots+2023) - 2 \cdot (1+2+\dots+1012) + (a_1+a_{2023}). \]Simplifying this calculation gives (*) as needed. Remark: If one seeks to prove (*) from the outset rather than the corollary $\min(a_1, a_{2023}) \ge 507$, then in fact there are many equality cases, including the ``obvious'' one $(1,2023,2,2022,3,2021,\dots)$. More generally, for any $a$ and $b$ with $a+b=1013$, the zigzag \[ (a, 2024-a, a+1, 2023-a, \dots, 1012,2023,1,2022,2,\dots,b) \]will work. So (*) is really the ``right'' equation to consider.
09.11.2024 18:44
The answer is $507$. Construction: Consider the union of the two sequences \[\mathcal S_1 = \left(506, 1518, 505, \dots, 506-i, 1518+i, \dots, 2, 2022, 1, 2023\right)\]and \[\mathcal S_2 = \left(1012, 1013, 1011, \dots, 1012+i, 1012-i, \dots, 1517, 507\right).\]The union $\mathcal S = \mathcal S_1 \cup \mathcal S_2$ in that order satisfies the conditions, yielding $\operatorname{max}(a_1, a_{2023}) = 507$. Proof of Bound: We will show that $a_1+a_{2023} \geq 1013$, which will imply the result. For each $1 \leq i \leq 2023$, we define $a_i$ to be a peak if $a_{i-1} < a_i$ and $a_i > a_{i-1}$. valley if $a_{i-1} > a_i$ and $a_i < a_{i-1}$. (We consider the inequalities vacuous if the index is not within range.) Let $A$ be the set of all peaks and $B$ be the set of all valleys. Note that $A$ and $B$ do not necessarily partition $[2023]$. Now, there are three cases to consider: Case 1: In this case, $a_1 < a_2$ and $a_{2022} > a_{2023}$, so $a_1$ and $a_{2023}$ are both in $B$. It follows that evaluating the absolute values, \[\sum_{i=1}^{2022} |a_i - a_{i+1}| = 2\left(\sum_{i \in A} a_i - \sum_{j \in B} a_j\right) + a_1 + a_{2023}\]because $a_1$ and $a_{2023}$ are only subtracted once in the sum. Notice that between any two peaks, there must be a valley, and vice versa, so it follows that if there are $k$ peaks, there are $k+1$ valleys (counting $a_1$ and $a_{2023}$). The sum is then upper bounded by \[\sum_{i \in A} a_i - \sum_{j \in B} a_j \leq \sum_{i=1}^k (2024-i) - \sum_{j=1}^{k+1} j = -\left(k^2-2022k+1\right).\]This quadratic is upper bounded by $1022120$ when $k=1011$, so it follows that \[2023 \cdot 1011 = \sum_{i=1}^{2022} |a_i - a_{i+1}| \leq 2(1022120) + (a_1+a_{2023})\]thus $a_1+a_{2023} \geq 1013$, as needed. Case 2: In this case, $a_1 > a_2$ and $a_{2022} < a_{2023}$, so $a_1$ and $a_{2023}$ are both in $A$. We take $A' = A \setminus \{a_1, a_{2023}\}$. Once again, \[\sum_{i=1}^{2022} |a_i-a_{i+1}| = 2\left(\sum_{i \in A'} a_i - \sum_{j \in B} a_j\right) + a_1+a_{2023}.\]The main term is once again bounded above by $-(k^2-2022k+1)$, but $k \leq 1010$, which yields $a_1+a_{2023} > 1013$ by the same logic in this case. Case 3: In this case, $a_1 < a_2$ and $a_{2022} < a_{2023}$ (or vice versa). We again take $A' = A \setminus a_{2023}$ and $a_1 \in B$, such that the previous display holds once again. This case then reduces to Case 1, which completes the proof. Remark: The difficulty on the problem rests on having the confidence that the standard global approach works! Small cases don't indicate that $a_1 +a_{2023} \geq 1013$ ought to be plausible, but it leads to the clever interpretation of $A$ and $B$ that gives the solution (and in fact is more or less necessary to prove given equality cases.)