How to prove $4\mid n$? How to prove that $4\mid n$ ? 
We know
$$\frac{x_1}{x_2}+\frac{x_2}{x_3}+\cdots+\frac{x_{n-1}}{x_n}+\frac{x_n}{x_1}=0.$$
and $x_1,x_2,\cdots,x_n$ is $1$ or $-1$. 
 A: Hint: what happens when you change the sign of just one of the $x_i$?
A: All the $x_i/x_j$'s in the sum is 1 or -1. Therefore you need an even number of them to make the sum 0, since every time you have a 1 you must have another -1 to cancel it out and vice versa. Multiplying toghether all the $x_i/x_j$'s, you get 1. So an even number of $x_i/x_j$'s equal -1. Then since there are as many $x_i/x_j$'s equal to 1 as $x_i/x_j$'s equal to -1, $n$ is twice that even number, hence divisible by 4. 
A: Prove using induction that $|x_i|=|x_j|\neq0, \ \ \forall  \ i,j\Longrightarrow\frac{x_1}{x_2}+\frac{x_2}{x_3}+\cdots+\frac{x_{n-1}}{x_n}+\frac{x_n}{x_1}\equiv n \pmod 4:$
$$\frac{x_1}{x_2}+\frac{x_2}{x_3}+\cdots+\frac{x_{n-1}}{x_n}+\frac{x_n}{x_1}=\\
\frac{x_1}{x_2}+\frac{x_2}{x_3}+\cdots+\frac{x_{n-1}}{x_1}+\left(\frac{x_{n-1}}{x_n}+\frac{x_n-x_{n-1}}{x_1} \right)\equiv \\ \equiv n-1 +\frac{x_{n-1}}{x_n}+\frac{x_n-x_{n-1}}{x_1} \pmod 4\equiv \\ (\text{cases }x_{n-1}=\pm x_n)\equiv n \pmod 4.$$
A: Let $x_i = (-1)^{a_i}$, where $a_i \in \{0, 1\}$. We are given:
$$\sum_{\text{cyclic}} (-1)^{a_i + a_{i+1}} = 0$$
Note that $(-1)^{x} = 1-2x$ for $x \in \{ 0,1\}$. Hence we always have
$$\sum_{\text{cyclic}} (-1)^{a_i + a_{i+1}}  = n - 2 \sum_{\text{cyc}} ((a_i + a_{i+1}) \mod 2)$$
Thus 
$$n = 2 \sum_{\text{cyc}} ((a_i + a_{i+1}) \mod 2)$$
Since $\sum_{\text{cyc}} ((a_i + a_{i+1}) \mod 2) = 2\sum a_i = 0 \mod 2$, we deduce that $n$ is divisible by $4$. We also find that in general, $\sum \frac{x_i}{x_{i+1}} \equiv n \mod 4$.
