Let $n > 0$ be a positive integer (large) and $p > 2$ a fixed prime number. What is the probability that $$\sum_{ 1 \leq i < j \leq n} a_ia_j = 0 \mod p$$ where $a_1, a_2, \dots a_n$ are chosen uniformly from the set $S = \{-1, 1\}$. Does this sum equidistribute mod $p$ as $n$ goes to infinity? What would be the speed of equidistribution in terms of $n$? Is there any literature in this type of random sums? I would be surprised if not but I am unable to find anything related or similar to this. One can also ask what is the probability of this sum being actually zero, but I also have no idea how to deal with it and thought that modulo a prime would be simpler.