Mathematically represent a missing element in a set so that it is summed as 0

notation

I currently have a fixed set of length $5$ denoted with elements $A = \{s_1,\ldots,s_5\}$. I have a function that takes each element and cubes it, then sums across all elements, so that

$$
S = \sum_{i=1}^5 s_i^3
$$

However, sometimes the set may be missing elements, for example, $s_4$ may be missing. In those cases, I would like for it to be a $0$ inside the sum, so that I get $S = s_1+s_2+s_3+0+s_5$. Is there a way to represent this in a rigorous way, perhaps by using an indicator function?

I am thinking that the sum can be defined as

$$
S = \sum_{i=1}^5 s_i^3 \cdot \mathbb{1}\left(s_i \in A\right)
$$

but I am having a hard time making this tight. Does anyone have suggestions? Thanks!

Best Answer

Honestly, your situation feels arbitrary. Neither the elements of a set nor the terms of a sum are ordered, so what you want might as well be $(|A|$ denotes the cardinality of the set $A)$ $$ S = \sum_{s \in A} s^3 + \sum_{i=1}^{5-|A|} 0,$$ which might as well just be $$ S = \sum_{s \in A} s^3. $$

Related Question