Consecutive sum divisible by the sequence length
ID: consecutive-sum-divisible-by-the-sequence-length
For any sequence of integers, some nonempty consecutive block has sum divisible by . Form the prefix sums . There are only residue classes modulo , so the pigeonhole principle gives for some . Subtraction proves that is the required block sum. Negative entries and repeated entries cause no difficulty. Applied after any ordering of a finite set, it also gives a nonempty subset whose sum is divisible by the size of the set.
New to topics? Read the docs here!