Skip to main content
1 of 2
David E Speyer
  • 156.2k
  • 14
  • 420
  • 763

First observation: There are no solutions for $n \equiv 3$ or $4 \bmod 8$. Let $k$ be the number of $a_i$ which are odd, then the number of $a_i+a_j$ which are odd is $k(n-k)$.

If $n \equiv 3 \bmod 8$, then $k(n-k)$ is even, but the number of odd elements modulo $\tfrac{n(n+1)}{2}$ is odd.

If $n \equiv 4 \bmod 8$, then $k(n-k)$ is either $0$ or $3 \bmod 4$, but the number of odd elements modulo $\tfrac{n(n+1)}{2}$ is $1 \bmod 4$.

David E Speyer
  • 156.2k
  • 14
  • 420
  • 763