Necessary Conditions for Existence of Skolem Sequence

Theorem: [Skolem 1957] A Skolem sequence of order $$n$$ can only exist if $$n\equiv 0,1 (\bmod{4})$$.

A Skolem sequence of order $$n$$ is a sequence $$S=\{s_1,s_2,...,s_{2n}\}$$ of $$2n$$ integers for which 1. For every $$k \in \{1,2,...,n\}$$ there exist exactly two elements $$s_i,s_j \in S$$ so that $$s_i=s_j=k$$ and 2. If $$s_i=s_j=k$$ and $$i<j$$ then $$j-i=k$$

Skolem credited his colleague Th. Bang with the following proof.

Proof :

Let $$S$$ be a Skolem sequence of order $$n$$ and let $$a_i$$ and $$b_i$$ be the positions of the first and second occurrences respectively of the integer $$i$$ in $$S$$, where $$1 \leq i \leq n$$. We can thus conclude that $$b_i - a_i = i,$$ for each $$i$$ from 1 to $$n$$. Summing both sides of this equation we obtain $$\sum_i^n b_i - \sum_i^n a_i = \sum_i^n i = \frac{n(n + 1)}{2}$$. Now the $$a_i$$ and the $$b_i$$ represent the positions in the sequence from 1 to $$2n$$, so we can see that $$\sum_i^n b_i + \sum_i^n a_i = \frac{2n(2n + 1)}{2} = n(2n + 1)$$. Summing the previous two equations we obtain the identity $$\sum_i^n b_i = \frac{n(5n + 3)}{4}$$. The left hand side of this last equality is a sum of positions and thus must be integer. We conclude that the right hand side must also be an integer, which occurs exactly when $$n \equiv 0, 1 (\bmod{4}). $$

Reference: