Let $S_n = \{1,2,\cdots, n\}$ for every positive integer n. Find the largest $n\in\mathbb{N}$ so that $\forall a_1,\cdots, a_7 \in S_n, \exists S,T \subseteq S_7, \sum_{i\in S} a_i = \sum_{j\in T} a_j$.
Let $P_n$ be the statement that $\forall a_1,\cdots, a_7 \in S_n, \exists S,T \subseteq S_7, \sum_{i\in S} a_i = \sum_{j\in T} a_j$. For $n=1, P_n$ obviously holds as $S$ and $T$ can be any one-element subsets for instance. For $n=2, $ observe that at least 4 elements must be equal, say to 2. Then we can pick S and T to be two distinct one-element subsets corresponding to indices i where $a_i=2$.
I'm not sure if it's useful to use the pigeonhole principle. There are obviously $2^n$ subsets of $S_n$ and the maximum sum of the $a_i$'s is $7n$. If there are more subsets of $\{1,\cdots, 7\}$ than possible sums of the $a_i$'s, we must be able to find two distinct subsets with the same sum. That is, for $7n < 128\Leftrightarrow n \leq 18$ we know that $P_n$ holds. But what about for larger values of $n$? Can we significantly narrow down the possible values of $\sum_{i\in S} a_i $ for $S\subseteq S_7$?