Subfield: Combinatorics


Question: Let $m, n$ be positive integers with $m>1$. Anastasia partitions the integers $1,2, \ldots, 2 m$ into $m$ pairs. Boris then chooses one integer from each pair and finds the sum of these chosen integers. Prove that Anastasia can select the pairs so that Boris cannot make his sum equal to $n$.

Solution:
Define the following ordered partitions:

$$
\begin{aligned}
& P_{1}=(\{1,2\},\{3,4\}, \ldots,\{2 m-1,2 m\}), \\
& P_{2}=(\{1, m+1\},\{2, m+2\}, \ldots,\{m, 2 m\}), \\
& P_{3}=(\{1,2 m\},\{2, m+1\},\{3, m+2\}, \ldots,\{m, 2 m-1\}) .
\end{aligned}
$$

For each $P_{j}$ we will compute the possible values for the expression $s=a_{1}+\ldots+a_{m}$, where $a_{i} \in P_{j, i}$ are the chosen integers. Here, $P_{j, i}$ denotes the $i$-th coordinate of the ordered partition $P_{j}$.

We will denote by $\sigma$ the number $\sum_{i=1}^{m} i=\left(m^{2}+m\right) / 2$.

- Consider the partition $P_{1}$ and a certain choice with corresponding sum $s$. We find that

$$
m^{2}=\sum_{i=1}^{m}(2 i-1) \leq s \leq \sum_{i=1}^{m} 2 i=m^{2}+m
$$

Hence, if $n<m^{2}$ or $n>m^{2}+m$, this partition gives a positive answer.

- Consider the partition $P_{2}$ and a certain choice with corresponding $s$. We find that

$$
s \equiv \sum_{i=1}^{m} i \equiv \sigma \quad(\bmod m)
$$

Hence, if $m^{2} \leq n \leq m^{2}+m$ and $n \not \equiv \sigma(\bmod m)$, this partition solves the problem.

- Consider the partition $P_{3}$ and a certain choice with corresponding $s$. We set

$$
d_{i}= \begin{cases}0 & \text { if } a_{i}=i \\ 1, & \text { if } a_{i} \neq i\end{cases}
$$

We also put $d=\sum_{i=1}^{m} d_{i}$, and note that $0 \leq d \leq m$. Note also that if $a_{i} \neq i$, then $a_{i} \equiv i-1$ $(\bmod m)$. Hence, for all $a_{i} \in P_{3, i}$ it holds that

$$
a_{i} \equiv i-d_{i} \quad(\bmod m)
$$

Hence,

$$
s \equiv \sum_{i=1}^{m} a_{i} \equiv \sum_{i=1}^{m}\left(i-d_{i}\right) \equiv \sigma-d \quad(\bmod m)
$$

which can only be congruent to $\sigma$ modulo $m$ if all $d_{i}$ are equal, which forces $s=\left(m^{2}+m\right) / 2$ or $s=\left(3 m^{2}+m\right) / 2$. Since $m>1$, it holds that

$$
\frac{m^{2}+m}{2}<m^{2}<m^{2}+m<\frac{3 m^{2}+m}{2} \text {. }
$$

Hence if $m^{2} \leq n \leq m^{2}+m$ and $n \equiv \sigma(\bmod m)$, then $s$ cannot be equal to $n$, so partition $P_{3}$ suffices for such $n$.



Note that all $n$ are treated in one of the cases above, so we are done.
Define the following ordered partitions:

$$
\begin{aligned}
& P_{1}=(\{1,2\},\{3,4\}, \ldots,\{2 m-1,2 m\}), \\
& P_{2}=(\{1, m+1\},\{2, m+2\}, \ldots,\{m, 2 m\}), \\
& P_{3}=(\{1,2 m\},\{2, m+1\},\{3, m+2\}, \ldots,\{m, 2 m-1\}) .
\end{aligned}
$$

For each $P_{j}$ we will compute the possible values for the expression $s=a_{1}+\ldots+a_{m}$, where $a_{i} \in P_{j, i}$ are the chosen integers. Here, $P_{j, i}$ denotes the $i$-th coordinate of the ordered partition $P_{j}$.

We will denote by $\sigma$ the number $\sum_{i=1}^{m} i=\left(m^{2}+m\right) / 2$.

- Consider the partition $P_{1}$ and a certain choice with corresponding sum $s$. We find that

$$
m^{2}=\sum_{i=1}^{m}(2 i-1) \leq s \leq \sum_{i=1}^{m} 2 i=m^{2}+m
$$

Hence, if $n<m^{2}$ or $n>m^{2}+m$, this partition gives a positive answer.

- Consider the partition $P_{2}$ and a certain choice with corresponding $s$. We find that

$$
s \equiv \sum_{i=1}^{m} i \equiv \sigma \quad(\bmod m)
$$

Hence, if $m^{2} \leq n \leq m^{2}+m$ and $n \not \equiv \sigma(\bmod m)$, this partition solves the problem.

Given the analysis of $P_{1}$ and $P_{2}$ as above, we may conclude (noting that $\sigma \equiv m(m+1) / 2(\bmod m))$ that if $m$ is odd then $m^{2}$ and $m^{2}+m$ are the only candidates for counterexamples $n$, while if $m$ is even then $m^{2}+\frac{m}{2}$ is the only candidate.

There are now various ways to proceed as alternatives to the partition $P_{3}$.

Consider the partition $(\{1, m+2\},\{2, m+3\}, \ldots,\{m-1,2 m\},\{m, m+1\})$. We consider possible sums $\bmod m+1$. For the first $m-1$ pairs, the elements of each pair are congruent $\bmod m+1$, so the sum of one element of each pair is $(\bmod m+1)$ congruent to $\frac{1}{2} m(m+1)-m$, which is congruent to 1 if $m+1$ is odd and $1+\frac{m+1}{2}$ if $m+1$ is even. Now the elements of the last pair are congruent to -1 and 0 , so any achievable value of $n$ is congruent to 0 or 1 if $m+1$ is odd, and to 0 or 1 plus $\frac{m+1}{2}$ if $m+1$ is even. If $m$ is even then $m^{2}+\frac{m}{2} \equiv 1+\frac{m}{2}$, which is not congruent to 0 or 1 . If $m$ is odd then $m^{2} \equiv 1$ and $m^{2}+m \equiv 0$, neither of which can equal 0 or 1 plus $\frac{m+1}{2}$.
Define the following ordered partitions:

$$
\begin{aligned}
& P_{1}=(\{1,2\},\{3,4\}, \ldots,\{2 m-1,2 m\}), \\
& P_{2}=(\{1, m+1\},\{2, m+2\}, \ldots,\{m, 2 m\}), \\
& P_{3}=(\{1,2 m\},\{2, m+1\},\{3, m+2\}, \ldots,\{m, 2 m-1\}) .
\end{aligned}
$$

For each $P_{j}$ we will compute the possible values for the expression $s=a_{1}+\ldots+a_{m}$, where $a_{i} \in P_{j, i}$ are the chosen integers. Here, $P_{j, i}$ denotes the $i$-th coordinate of the ordered partition $P_{j}$.

We will denote by $\sigma$ the number $\sum_{i=1}^{m} i=\left(m^{2}+m\right) / 2$.

- Consider the partition $P_{1}$ and a certain choice with corresponding sum $s$. We find that

$$
m^{2}=\sum_{i=1}^{m}(2 i-1) \leq s \leq \sum_{i=1}^{m} 2 i=m^{2}+m
$$

Hence, if $n<m^{2}$ or $n>m^{2}+m$, this partition gives a positive answer.

- Consider the partition $P_{2}$ and a certain choice with corresponding $s$. We find that

$$
s \equiv \sum_{i=1}^{m} i \equiv \sigma \quad(\bmod m)
$$

Hence, if $m^{2} \leq n \leq m^{2}+m$ and $n \not \equiv \sigma(\bmod m)$, this partition solves the problem.

Given the analysis of $P_{1}$ and $P_{2}$ as above, we may conclude (noting that $\sigma \equiv m(m+1) / 2(\bmod m))$ that if $m$ is odd then $m^{2}$ and $m^{2}+m$ are the only candidates for counterexamples $n$, while if $m$ is even then $m^{2}+\frac{m}{2}$ is the only candidate.

There are now various ways to proceed as alternatives to the partition $P_{3}$.
Consider the partition $(\{1, m\},\{2, m+1\}, \ldots,\{m-1,2 m-2\},\{2 m-1,2 m\})$, this time considering sums of elements of pairs $\bmod m-1$. If $m-1$ is odd, the sum is congruent to 1 or 2 ; if $m-1$ is even, to 1 or 2 plus $\frac{m-1}{2}$. If $m$ is even then $m^{2}+\frac{m}{2} \equiv 1+\frac{m}{2}$, and this can only be congruent to 1 or 2 when $m=2$. If $m$ is odd, $m^{2}$ and $m^{2}+m$ are congruent to 1 and 2 , and these can only be congruent to 1 or 2 plus $\frac{m-1}{2}$ when $m=3$. Now the cases of $m=2$ and $m=3$ need considering separately (by finding explicit partitions excluding each $n$ ).
Define the following ordered partitions:

$$
\begin{aligned}
& P_{1}=(\{1,2\},\{3,4\}, \ldots,\{2 m-1,2 m\})
\end{aligned}
$$

For each $P_{j}$ we will compute the possible values for the expression $s=a_{1}+\ldots+a_{m}$, where $a_{i} \in P_{j, i}$ are the chosen integers. Here, $P_{j, i}$ denotes the $i$-th coordinate of the ordered partition $P_{j}$.

We will denote by $\sigma$ the number $\sum_{i=1}^{m} i=\left(m^{2}+m\right) / 2$.

- Consider the partition $P_{1}$ and a certain choice with corresponding sum $s$. We find that

$$
m^{2}=\sum_{i=1}^{m}(2 i-1) \leq s \leq \sum_{i=1}^{m} 2 i=m^{2}+m
$$

Hence, if $n<m^{2}$ or $n>m^{2}+m$, this partition gives a positive answer.

This solution does not use modulo arguments. Use only $P_{1}$ from above to conclude that $m^{2} \leq n \leq m^{2}+m$. Now consider the partition $(\{1,2 m\},\{2,3\},\{4,5\}, \ldots,\{2 m-$ $2,2 m-1\})$. If 1 is chosen from the first pair, the sum is at most $m^{2}$; if $2 m$ is chosen, the sum is at least $m^{2}+m$. So either $n=m^{2}$ or $n=m^{2}+m$. Now consider the partition $(\{1,2 m-$ $1\},\{2,2 m\},\{3,4\},\{5,6\}, \ldots,\{2 m-3,2 m-2\})$. Sums of one element from each of the last $m-2$ pairs are in the range from $(m-2) m=m^{2}-2 m$ to $(m-2)(m+1)=m^{2}-m-2$ inclusive. Sums of one element from each of the first two pairs are $3,2 m+1$ and $4 m-1$. In the first case we have $n \leq m^{2}-m+1<m^{2}$, in the second $m^{2}+1 \leq n \leq m^{2}+m-1$ and in the third $n \geq m^{2}+2 m-1>m^{2}+m$. So these three partitions together have eliminated all $n$.