Notation of the summation of a set of numbers

I'd write either $\displaystyle\quad\sum_{i=1}^{|S|} x_i\quad$ or $\displaystyle\quad\sum_{x\in S} x$.

If the second form is used, then the subscript is just clutter.

Some mathematicians (perhaps especially set theorists?) might write $\displaystyle \sum S$. This would parallel the way set theorists write $\displaystyle \bigcup S$ where others might write $\displaystyle \bigcup_{x\in S} x$.


Both expressions are acceptable with the second being more usual in this context.

The expression $$\sum_{x \in S} x$$ is more common when $S$ is implicitly defined, e.g., when one is summing over all prime numbers. The expression $$\sum_{i =1}^{|S|} x_i$$ would be more common here because you are explicitly given the list of elements of the set $S$.