What is the energy of each of these configurations?
For small systems, the way we treat the ends matters. Two cases are often used.
In the first case we employ what is called free ends. This means that there is no contribution from points to the right or left of the endpoints. For the one-dimensional case, the energy is then written as a sum over a single index $$ \begin{equation*} E_i =-J\sum_{j=1}^{N-1}s_js_{j+1}, \end{equation*} $$