Let $n\ge 3$, $d$ be positive integers. For an integer $x$, denote $r(x)$ be the remainder of $x$ when divided by $n$ such that $0\le r(x)\le n-1$. Let $c$ be a positive integer with $1<c<n$ and $\gcd(c,n)=1$, and suppose $a_1, \cdots, a_d$ are positive integers with $a_1+\cdots+a_d\le n-1$. (a) Prove that if $n<2d$, then $\displaystyle\sum_{i=1}^d r(ca_i)\ge n.$ (b) For each $n$, find the smallest $d$ such that $\displaystyle\sum_{i=1}^d r(ca_i)\ge n$ always holds. Proposed by Yeoh Zi Song & Anzo Teh Zhao Yang
Problem
Source: Malaysian APMO CST 2023 P5
Tags: number theory
20.02.2023 19:07
Denote, for each $n$, the minimum $d$ for which the conclusion holds as $d(n)$. We claim the following: \[ d(n) = \begin{cases} \lceil\frac n2\rceil & 4\mid n\text{ or }n\text{ odd}\\ 2\cdot\lceil\frac n6\rceil & 4\mid n - 2\\ \end{cases} \] We first construct a counterexample with $d = d(n) - 1$ such numbers. There are four small cases: For $n$ odd: $a_i\equiv 1$, $c=2$. For $n$ divisible by 4: $c=\frac n2 + 1$ is odd, and $\gcd(c, n)=\gcd(c, 2)=1$. Therefore taking this $c$, we may take $a_i\equiv 2$ and $r(ca_i) = r(n + 2) =2$ too. $3\mid n$ and $4\mid n - 2$. consider $c_1=\frac n3 + 1$ and $c_2 = \frac{2n}{3}+1$. Then $\gcd(c_1, n)=\gcd(3, n)$ and $\gcd(c_2, 2n)=\gcd(3, 2n)$, but $\gcd(c_1, c_2)=1$ so they cannot be simultaneously divisible by 3. Thus one of them can be chosen as our $c$ and therefore we may take $a_i\equiv 3$, which also gives $r(ca_i) = r(3c) =3$. This means we need at least $d = \frac n3$ which settles for $n=12k+6$. $3\nmid n$ and $4\mid n - 2$. Take $c = 3$, $a_1 = \cdots = a_{d - 1} = 1$, and $a_d = \frac{n + a}{3}$ where $a\in \{1, 2\}$ is such that $3\mid n + a$. Then $r(a_i) = 3, \cdots, 3, a$. Now that $n\ge 10$ in this case, \[ \sum a_i = d - 1 + \frac{n + a}{3}\le \frac{n + 2 + n + 1}{3} < n \qquad \sum r(ca_i) = 3(d-1) + a = 3(d - 1) + a \]If $n=12k+10$, then $a = 2$ and taking $d=d(n) - 1 = \frac{n-1}{3}$ we have $3(d - 1) + 2 = n - 2$. If $n=12k+10$, then $a = 1$ and taking $d=d(n) - 1 = \frac{n+1}{3}$ we have $3(d - 1) + 1 = n - 1$. It remains to show that these $d(n)$ work. We first tackle the general case, showing that $d(n)\le \lceil \frac n2\rceil$. Now suppose that $d \ge \lceil \frac n2\rceil$. Since $\gcd(c, n) = 1$ and $1 < c < n$, $r(c) > 1$. In the case where $n$ is even, too, we have $a\equiv r(ca)\pmod{2}$. This gives $a + r(ca)\ge 4$ for all $a$ since we cannot have $a=r(a)=1$. Thus $\sum a_i+\sum r(ca_i)\ge 4d\ge 2n$ whenever $d\ge \frac n2$, implying that one of the summations must be at least $n$. In the case where $n$ is odd, the condition $a+r(ca)\ge 4$ fails only when $\{a, r(ca)\}=\{1, 2\}$. W.l.o.g. suppose $a = 1$, $r(ca)=2$. Then the $c$ satisfying this is $c = 2$. Now, if $r(2a_i)\ge 2$ for all $i$ then we are done. Otherwise, $r(2a_i)=1$ for some $a_i$; this $a_i$ can only be $\frac{n+1}{2}$. If there are at least $\frac{n+1}{2}$ such $a_i$'s, $\sum a_i\ge n+1$; else there's exactly one such $a_i$, leading to $\sum r(ca_i) \ge 2(d - 1) + 1 \ge (n-1)+1 = n$. It remains to establish the case when $n=4k+2$. We'll now assume that $d\ge \frac n3$. We first observe that we cannot have $r(2c)=2;$ the only such $c$'s are $c=1$ or $c=\frac n2+1$, but the latter $c$ is even. Recall also that $a$ and $r(ca)$ have the same parity. If $3\mid n$, then $c\ge 5$. It then follows that $r(c)\ge 5, r(2c)\ge 4, r(3c)\ge 3, r(4c)\ge 2$ and $r(5c)\ge 1$. Thus regardless of $c$, $a + r(ca)\ge 6$ and therefore when $d=\frac n3$, $\sum a_i + \sum r(ca_i)\ge 6d=2n$, implying one of them has to be $\ge n$. Now consider the case $3\nmid n$.If $a_i + r(ca_i) \ge 6$ for all $a_i$'s we're done. With $r(2c) > 2$, the only time where $a + r(ca) < 6$ is when $\{a, r(ca)\}=\{1, 3\}$ (they cannot be 1 simultaneously). Again, by symmetry, we consider $a=1, r(ca)=3$ (hence $c = 3$). For each integer $x$, call $x$ funny if $x = \frac{na+b}{3}$ for some $a, b\in \{1, 2\}$. We see that $r(3x)\in \{1, 2\}$ if and only if $x$ is funny. Now we consider these cases: There is no funny $a_i$'s. Then $r(3a_i)\ge 3$ for all $a_i$ and $\sum r(3a_i)\ge 3d\ge n$. There are at least 3 funny $a_i$'s. Then $\sum a_i\ge 3\cdot\frac{n+1}{3}\ge n+1$. There are two funny $a_i$'s. If one of them is of the form $\frac{2n+b}{3}$, $\sum a_i\ge \frac{2n+1+n+1}{3} > n$; otherwise, both are in the form $\frac{n+a}{3}$; notice $3\mid n+a$. Meanwhile, $\sum a_i\ge 3(d-2) + 2a$. For $n=12k+10, a=2$ so $\sum r(ca_i)\ge 3d-2$; for $n=12k+2$, $a=1$ so $\sum r(ca_i)\ge 3d-4$. There are one funny $a_i$'s. This means $\sum r(ca_i) \ge 3(d-1)+1=3d-2$. Therefore combining the cases above, for $n=12k+10$, $3d(n)-4=3(\frac{n+4}{3})-4=n$; for $n=12k+2$, $3d(n)-2=3(\frac{n+2}{3})-2=n$. This completes the proof that one of $\sum a_i$ and $\sum r(ca_i)$ must be at least $n$.
13.10.2023 10:24
Solution that solves only part (a): (From the official packet) Without loss of generality, suppose $a_1 \le a_2 \le \ldots \le a_d$. Furthermore, let $k$ be the largest integer for which $a_k \le \frac{n-1}{c}$. Let $S:=a_1+a_2+\ldots+a_k$. First, observe that $$S+(d-k) \cdot \frac{n}{c} \le a_1+a_2+\ldots +a_d \le n-1,$$so rearranging gives $$ k + \frac{c(n-1-S)}{n} \ge d \ge \frac{n+1}{2}.$$ We will prove that $cS + \frac{n+1}{2}-k \ge n$, which will imply the result since $$\sum_{i=1}^{d}r(ca_i) \ge (ca_1+ca_2+\ldots+ca_k)+(d-k) \ge cS+\frac{n+1}{2}-k.$$Note that (\ref{eq}) implies \begin{align*} k &\ge \frac{n+1}{2}-\frac{c(n-1-S)}{n} \\&\ge \frac{n+1}{2}-\frac{c(n-1-k)}{n} \\&= \frac{n+1}{2}-\frac{c(n-1)}{n}+\frac{ck}{n}. \end{align*}So, $k\left(1-\frac{c}{n}\right) \ge \frac{n+1}{2}-\frac{c(n-1)}{n}$, which implies $$k \ge \frac{n(n+1-2c)+2c}{2(n-c)}.$$Now, note that $k \ge 2$, since otherwise $a_2,a_3,\ldots,a_d \ge 2$, which implies $\sum_{i=1}^{d} a_i \ge 2d-1 > n-1$. Hence, if $c \ge \frac{n+3}{4}$, we have $cS+\frac{n+1}{2}-k \ge (c-1)k+\frac{n+1}{2} \ge n$, as desired (note that we used the inequality $S \ge k$). Thus, we assume $c < \frac{n+3}{4} \le \frac{n+2}{3}$. In this case, \begin{align*} k &\ge \frac{n(n+1-2c)+2c}{2(n-c)} \\&\ge n \cdot \frac{n+1-2c}{2(n-c)} \\&\ge n \cdot \frac{1}{2} \end{align*}for $c \le \frac{n+2}{3}$. Hence, $$cS+\frac{n+1}{2}-k \ge (c-1)k+\frac{n+1}{2} \ge (c-1)\frac{n}{2}+\frac{n+1}{2} \ge n,$$where we used $S \ge k$ for the first inequality, as desired.