# Combining set builder and summation notation

What's the best notation for the sum of a subset?

Given $S = \{1,2,3,4,5,6,7\}$, let's say I want to find the sum of the squares of elements less than 4.

Initially I used the following notation: $$\sum_{\{i \in S:i<4\}}i^2$$

But I thought there is missing information, since only the set is provided. Here's alternative #1: $$\sum_{i\in\{x \in S:x<4\}}i^2$$

That seems verbose, so here's alternative #2, with some reordering: $$\sum\{i^2:i \in S:i <4\}$$

Which of the above is best, and is there an even better notation?

• If you use this sum more than once or twice, you should consider defining $T=\{x\in S:x<4\}$. Then your sum can be over $i\in T$. Also, your alternative#2 with the double colons, is highly nonstandard. – vadim123 Dec 14 '13 at 19:24
• It's only used once in my case, but that is a good idea, thanks. – imsky Dec 14 '13 at 19:29
• Yes, instead of $\{i^2 : i\in S : i< 4\}$, you should write $\{i^2 : i\in S\text{ and }i<4\}$. – Alex Kruckman Dec 14 '13 at 22:08

It's pretty common to see notation like $$\sum_{\substack{i \in S \\ i < 4}} i^2$$
Here the $i<4$ is a condition you're imposing on the $i$ appearing in the sum (in addition to $i\in S$).
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}