# The notation for a sum of many sums

I'm struggling to find nonobtrusive notation for the nested sum of many sums. One way to express the sum of $$K$$ nested sums is: $$A = \sum_{i_1=1}^{m_1} \sum_{i_2=1}^{m_2^{(i_1)}}\dots \sum_{i_K=1}^{m_K^{(i_1, i_2, \dots, i_{K-1)}}} a_{i_1,i_2, \dots, i_K}x_{i_1,i_2, \dots, i_K}.$$

I've written the above in the most general form, where the number of elements being summed in the $$k$$th sum — $$m_k^{(i_1, i_2, \dots, i_{k-1})}$$ — is a function of the previous indices: $$i_1, i_2, \dots, i_{k-1}$$. However, the above is clearly kind of messy and really not ideal. I was wondering if there is some simpler way to express the above that I'm not thinking of. Thank you!

• Generally, we define a set of all $(i_1,\dots,i_k)$ and write: $$\sum_{\mathbf i\in S} a_{\mathbf i} x_{\mathbf i }$$ Commented Jun 20, 2021 at 11:36

## 1 Answer

Let $$I = \{ (i_1, \ldots, i_K) \in \mathbb{N}^K \mid 1 \leq i_1 \leq m_1,\ 1 \leq i_2 \leq m_2^{(i_1)},\ \ldots, 1 \leq i_K \leq m_K^{(i_1,\ldots,i_{K-1})}.$$ Then you can just write $$A = \sum_{i\in I} a_i x_i.$$