Prove that n is divisible by 4 in a cylic sum with variables which have only two possible values

254 Views Asked by At

It is known that $a_1, a_2, a_3, ... , a_n \in \left\{-1, 1 \right\}$ and $S = a_1a_2a_3a_4 + a_2a_3a_4a_5 + ... + a_na_1a_2a_3 = 0$

Prove that $n \equiv 0\space(mod\space 4)$

I know this problem can be solved using number theory, but I am looking for a solution utilizing the concept of invariance.

I was able to identify an invariant of sorts: even if you change the sign of any $a_i$, the sum will still remain congruent to same number $mod \space 4$. It can be proved using this invariant that no matter what values you choose for each of the $a_i$, $S \equiv 0 \space (mod \space 4)$. It is not yet clear how I can prove the required statement using this result.

2

There are 2 best solutions below

1
On

After some thought I got the answer: we can start changing the signs of each of the $a_i$ until all the $a_i$s are positive at which point $S ≡ 0 \space (mod \space 4)$, and $S = n$. Which proves the statement since $n ≡ 0 \space (mod \space 4)$

0
On

You could do it in two steps.

  1. You have a sum of $\pm 1$ which is equal to zero, therefore $n$ must be even.

  2. The product of the terms $y_i=x_ix_{i+1}x_{i+2}x_{i+3}$ is equal to $1$, so there are an even number of $y_i$ which are equal to $-1$.

But the number of $1$'s is equal to the number of $-1$'s so the total number of terms, $n$, is two times an even number and must be a multiple of $4$.