Let $x_1, \ldots, x_n$ be integers. Then are there indices $1\le a\le b\le n$ such that $$\sum_{i=a}^b x_i$$ is a multiple of $n$?
Asked
Active
Viewed 581 times
5
-
I originally ruled out the possibility that $a=b$, but this is necessary: The sequence $1,0,1$ has no subsequence that sums to a multiple of 3 unless you allow $a=b=2$. – MJD Jun 16 '13 at 02:53
-
A sequence of $n$ elements is necessary for there to be a subsequence that sums to a multiple of $n$. The sequence $1,1,\ldots, 1$ of length $n-1$ is a counterexample. – MJD Jun 16 '13 at 02:54
-
This is a zero-sum problem, similar to the EGZ theorem. Your version adds the condition that the subsequence be consecutive, while EGZ adds the condition of exactly n summands in the subsequence. – vadim123 Jun 16 '13 at 03:16
-
This is also discussed at http://www.cut-the-knot.org/pigeonhole/group.shtml – MJD Aug 23 '13 at 16:22
1 Answers
6
Let $$s_k = \sum_{i=1}^k x_i\pmod n.$$ If $s_k$ is zero for any $k$, we have found the desired subsequence ($a=1, b=k$), so suppose all the $s_k$ are nonzero. There are $n$ of them, each in the range $1,\ldots,n-1$, so two, say $s_{a}$ and $s_b$, must be equal. Then since $s_b - s_a = 0$, we have $$\begin{align} \sum_{i=1}^b x_i - \sum_{i=1}^{a} x_i & = 0\pmod n \\ \sum_{i=a+1}^b x_i & = 0\pmod n \end{align}$$
as desired.
(Note that if $a+1 = b$, that is all right; it just means that $x_b$ itself is a multiple of $n$.)
MJD
- 67,568
- 43
- 308
- 617