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!