# 2009 USAMO Problems/Problem 2

## Problem

Let $n$ be a positive integer. Determine the size of the largest subset of $\{ - n, - n + 1, \ldots , n - 1, n\}$ which does not contain three elements $a, b, c$ (not necessarily distinct) satisfying $a + b + c = 0$.

## Solution 1

Let $S$ be a subset of $\{-n,-n+1,\dots,n-1,n\}$ of largest size satisfying $a+b+c\neq 0$ for all $a,b,c\in S$. First, observe that $0\notin S$. Next note that $|S|\geq \lceil n/2\rceil$, by observing that the set of all the odd numbers in $\{-n,-n+1,\dots,n-1,n\}$ works. To prove that $|S|\leq \lceil n/2\rceil$, it suffices to only consider even $n$, because the statement for $2k$ implies the statement for $2k-1$ as well. So from here forth, assume $n$ is even.

For any two sets $A$ and $B$, denote by $A+B$ the set $\{a+b\mid a\in A,b\in B\}$, and by $-A$ the set $\{-a\mid a\in A\}$. Also, let $A_+$ denote $A\cap\{1,2,\dots\}$ and $A_-$ denote $A\cap\{-1,-2,\dots\}$. First, we present a lemma:

Lemma 1: Let $A$ and $B$ be two sets of integers. Then $|A+B|\geq|A|+|B|-1$.

Proof: Write $A=\{a_1,\dots,a_n\}$ and $B=\{b_1,\dots,b_m\}$ where $a_1<\dots and $b_1<\dots. Then $a_1+b_1,a_1+b_2,\dots,a_1+b_m,a_2+b_m,\dots,a_n+b_m$ is a strictly increasing sequence of $n+m-1$ integers in $A+B$.

Now, we consider two cases:

Case 1: One of $n,-n$ is not in $S$. Without loss of generality, suppose $-n\notin S$. Let $U=\{-n+1,-n+2,\dots,n-2,n-1,n\}$ (a set with $2n$ elements), so that $S\subseteq U$ by our assumption. Now, the condition that $a+b+c\neq 0$ for all $a,b,c\in S$ implies that $-S\cap(S_++S_-)=\emptyset$. Since any element of $S_++S_-$ has absolute value at most $n-1$, we have $S_++S_-\subseteq \{-n+1,-n+2,\dots,n-2,n-1\}\subseteq U$. It follows that $S_++S_-\subseteq U\setminus -S$, so $|S_++S_-|\leq 2n-|S|$. However, by Lemma 1, we also have $|S_++S_-|\geq |S_+|+|S_-|-1=|S|-1$. Therefore, we must have $|S|-1\leq 2n-|S|$, or $2|S|\leq 2n+1$, or $|S|\leq n$.

Case 2: Both $n$ and $-n$ are in $S$. Then $n/2$ and $-n/2$ are not in $S$, and at most one of each of the pairs $\{1,n-1\},\{2,n-2\},\ldots,\{\frac n2-1,\frac n2+1\}$ and their negatives are in $S$. This means $S$ contains at most $2+(n-2)=n$ elements.

Thus we have proved that $|S|\leq n=\lceil n/2\rceil$ for even $n$, and we are done.

## Solution 2

Let $Z_n$ be the set of subsets satisfying the $a+b+c \neq 0$ condition for $n$, and let $s_n$ be the largest size of a set in $Z_n$. Let $n = 2k$ if $n$ is even, and $n = 2k-1$ if $n$ is odd. We note that $s_n \ge 2k$ due to the following constuction: $$\{-2k+1, -2k + 3, \ldots, 2k-3, 2k-1\}$$ or all of the odd numbers in the set. Then the sum of any three will be odd and thus nonzero.

Lemma 1: $s_{n+1} \le s_{n} + 2$. If $M_{n+1} \in Z_{n+1}, |M_{n+1}| = s_{n+1}$, then we note that $M_{n+1} \setminus \{-2n+1, 2n-1\} \in Z_n$, so $|M_{n+1}| - 2 \le s_n$. $\square$

Lemma 2: $s_{2k} = s_{2k-1}$. Suppose, for sake of contradiction, that $M_{2k} \in Z_{n+1}$ and $M_{2k} > s_{2k-1}$. Remove $2k,-2k$ from $M_{2k}$, and partition the rest of the elements into two sets $P_{2k-1}, Q_{2k-1}$, where $P$ and $Q$ contain all of the positive and negative elements of $M_{2k}$, respectively. (obviously $0 \not \in M_{2k}$, because $0+0+0 = 0$). WLOG, suppose $|P_{2k-1}| \ge |Q_{2k-1}|$. Then $|P_{2k-1}| + |Q_{2k-1}| \ge s_{2k-1} - 1 \ge 2k - 1$. We now show the following two sub-results:

Sub-lemma (A): if $|P_{2k-1}| \ge k$, $-2k \not \in M_{2k}$ [and similar for $Q$]; and

Sub-lemma (B): we cannot have both $|P_{2k-1}| + |Q_{2k-1}| \ge 2k$ and $|Q_{2k-1}| < k$ simultaneously hold.

This is sufficient, because the only two elements that may be in $M_{2k}$ that are not in $P_{2k-1}, Q_{2k-1}$ are $2k$ and $-2k$; for $M_{2k} > s_{2k-1}$, we must either have $|P_{2k-1}| + |Q_{2k-1}| = s_{2k-1} - 1 \ge 2k-1$ and both $2k,-2k \in M_{2k}$ [but by pigeonhole $|P_{2k-1}| \ge k$, see sub-lemma (A)], or $|P_{2k-1}| + |Q_{2k-1}| = s_{2k-1} \ge 2k$, and $2k \in M_{2k}$, in which case by (A) we must have $|Q_{2k-1}| < k$, violating (B).

(A): Partition $\{1,2,\ldots,2k-1\}$ into the $k$ sets $\{k\}, \{1,2k-1\}, \{2, 2k-2\}, \cdots, \{k-1, k+1\}$. Because $(k+\delta) + (k-\delta) - 2k = 0$, then if any of those sets are within $P_{2k-1}$, $-2k \not \in M_{2k}$. But by Pigeonhole at most $k-1$ elements may be in $P_{2k-1}$, contradiction.

(B): We prove this statement with another induction. We see that the statement easily holds true for $k=1$ or $2$, so suppose it is true for $k-1$, but [for sake of contradiction] false for $k$. Let $P_{2k-3} = P_{2k-1} \setminus \{2k-2, 2k-1\}$, and similarly for $Q_{2k-3}$. Again WLOG $|P_{2k-3}| \ge |Q_{2k-3}|$. Then we have $|P_{2k-1}| + |Q_{2k-1}| \le |P_{2k-3}| + |Q_{2k-3}| + 4$.

• If $|P_{2k-3}| + |Q_{2k-3}| \ge 2k-2$, then by inductive hypothesis, we must have $|P_{2k-3}| = |Q_{2k-3}| = k-1$. But (A) implies that we cannot add $2k-2$ or $-2k+2$. So to satisfy $|P_{2k-1}| = |Q_{2k-1}| \ge 2k$ we must have $2k-1, -2k+1$ added, but then $|P_{2k-1}| = |Q_{2k-1}| = k$ contradiction.
• If $|P_{2k-3}| + |Q_{2k-3}| = 2k-3$, then at least three of $\{2k-2, 2k-1, -2k+2, -2k + 1\}$ added. But $|P_{2k-3}| \ge k-1$, and by (A) we have that $-2k+2$ cannot be added. If $|P_{2k-3}| \ge k$, then another grouping similar to (A) shows that $-2k+1$ canno be added, contradiction. So $|P_{2k-3}| = k-1$, $|Q_{2k-3}| = k-2$, and adding the three remaining elements gives $|P_{2k-1}| = |Q_{2k-1}| = k$ contradiction.
• If $|P_{2k-3}| + |Q_{2k-3}| = 2k-4$, then all four of $\{2k-2, 2k-1, -2k+2, -2k + 1\}$ must be added, and furthermore $|P_{2k-3}| > |Q_{2k-3}|$. Then $|P_{2k-3}| \ge k-1$, and by previous paragraph we cannot add $-2k+2$. $\square$

So we have $\begin{cases} s_1 &= 2 \\ s_{2k} &= s_{2k-1} \\ s_{2k-1} &\le s_{2k-2} + 2 \\ \end{cases}$ and by induction, that $s_n \le \boxed{2\left\lceil \frac n2 \right \rceil} = 2k$, which we showed is achievable above.