Is there $1\leq n<l\leq m-1$ such that $\sum_{i=n}^la_i= m$? ($\{a_i\}_{i=1}^m\subseteq \{1, 2,\ldots, m-1\}$. )

21 Views Asked by At

Consider finite sequence $\{a_i\}_{i=1}^m\subseteq \{1, 2,\ldots, m-1\}$.

Is there $1\leq n<l\leq m-1$ such that $\sum_{i=n}^la_i= m$?

1

There are 1 best solutions below

0
On

This could not be true for suffice large $m$, and the residue thing could be checked in a finite time.

you just need to divide $\{1,2,...,m\}$ into two part $A=\{1,2,...,[\frac{m}{2}]\}$, $B=\{[\frac{m}{2}]+1,...,m\}$.

And the first step is to fill odd positions by $B$ in a randomness way. And fill the residue by $A$. we are done.