The condition when the sum of consecutive product of $\pm 1$ is $0$ Let $N\in \Bbb N$ and $x_i = \pm1$ for all $1\leq i \leq N$.
Assume that
$$
x_1x_2+x_2x_3+\cdots+x_Nx_1 = 0
$$
How can I prove that $N$ is divisible by $4$?
 A: Suppose that there are exactly $k\le n$ products equals to $1$, then the remaining $n-k$ products are equal to $-1$. So the sum is $k-(n-k)=2k-n\equiv n \pmod 2$. So to be the sum $0$ you have the first result $n\equiv 0 \pmod 2$, i.e. $2\mid n$.
Suppose you have exactly $m$ of the $x_k$s equals to $1$ and the other $n-m$ equals to $-1$. Then you see that:
$x_1x_2+x_2x_3+...+x_nx_1=0\iff 2x_1x_2+2x_2x_3+...+2x_nx_1=0$
But $2x_1x_2+2x_2x_3+...+2x_nx_1= (x_1+x_2+...+x_n)^2-(x_1^2+x_2^2+...+x_n^2)$ so we obtain   $$(x_1+x_2+...+x_n)^2=x_1^2+x_2^2+...+x_n^2\iff (2m-n)^2=n\iff 4m^2-4mn+n^2=n\iff n(n-1)=n^2-n=4(mn-m^2)$$
Since $n$ and $n-1$ must be coprime $4\mid n$ or $4\mid n-1$, but $n-1$ is odd. So $n$ is multiple of $4$.
A: Each $x_ix_{i+1}$ is odd, so $N$ is certainly even. We now prove if $N=4k+2$ the sum will be of the form $4l+2$. It will be if all $x_i$ are $1$ (the sum will then be $N$ so $l=k$), and each $1$ I subsequently change to a $-1$ either has no effect, due to it being multiplied by a $1$ and a $-1$ in different terms, or causes a change of size $4$ (due to multiplying $-2$ by the sum of either two $1$s or two $-1$s), i.e. $l$ changes by $1$ or $-1$.
