Can $S_n=a_1a_2+a_2a_3+\cdots+a_na_1=0$ if $a_i=±1$ for $n=28$ and $n=30$?

Write $$S_{30}=S_{28} -a_{28}a_1+a_{28}a_{29}+a_{29}a_{30}+a_{30}a_{1}$$

If $S_{30}=0=S_{28}$,

$$0=-a_{28}a_1+a_{28}a_{29}+a_{29}a_{30}+a_{30}a_{1}$$

$$a_{28}(a_{1}-a_{29})=(a_{29}+a_{1})a_{30}$$

But one of $(a_{1}-a_{29})$, $(a_{29}+a_{1})$ is zero, while other is not.

Hence impossible.


Hint: Show that if $ S_n = 0$, then $4 \mid n$.
Your work supports this hypothesis, so prove it.

Corollary: $S_{30}$ is never 0.


Clearly we need $ 2 \mid n$. (Your work hints at this strongly.)

Suppose that there are $a$ terms of the form $+1$ and $b$ terms of the form $-1$.
Then, $ n = a + b$, and $ 0 = a - b$.

What is $ 1^a (-1)^b$ in 2 different ways?
Thus, show that $b$ is even, so $ 4 \mid n$.