Even Pairs partial sums Similarly to the tutorial, we count the number of even sums from $x_0$ to $x_i$ (lets call this quantity $E$). Then the number of even "sub-sums" is $$ {E \choose 2} + {{n - E} \choose 2} + E. $$