Given $n$ integers $a_1, a_2,\cdots,a_n,$ such that for each $1\leq i \leq n$, it holds that $1 \leq a_i \leq n$. The problem is to prove that there exists a nonempty subsequence (not necessarily consecutive) of these integers, whose sum is equal to the sum of their indices.
Formally, it is to prove that there exists a nonempty subset $S \subseteq [n]$ that $\sum_{i\in S}a_i = \sum_{i \in S}i$, where $1 \leq a_i \leq n$.
The idea for the proof might be the pigeonhole principle, but I am stuck on how to construct the appropriate pigeons and pigeonholes.