I have a $n\times n$ matrix and I need to express with sigma notation all the elements of the matrix above the main diagonal (including the main diagonal).
So basically this is my sum: $$a_{1}^{1}+a_{2}^{1}+\ldots+a_{n}^{1}+a_{2}^{2}+a_{3}^{2}+\ldots+a_{n}^{2}+\ldots+a_{n-1}^{n-1}+a_{n}^{n-1}+a_{n}^{n}\\=\sum_{i=1}^{n}a_{i}^{1}+\sum_{i=2}^{n}a_{i}^{2}+\ldots+\sum_{i=n-1}^{n}a_{i}^{n-1}+\sum_{i=n}^{n}a_{i}^{n}$$ I think that it can be expressed thus: $\underset{i\le j\le n}{\underset{1\le i\le n}{\sum}}a_{j}^{i}$ but I'm not sure about it. I'm also trying to figure whether it can be expressed like this: $\sum_{j=i}^{n}\sum_{i=1}^{n}a_{j}^{i}$ or like this: $\sum_{i=1}^{n}\sum_{j=i}^{n}a_{j}^{i}$ and which of them is the correct way to express the sum.
If someone can explain how double sigmas with two related indices work it will help a lot. What I specifically don't understand is which index and which sum gets the priority.
In the expression $\sum_{j=i}^{n}\sum_{i=1}^{n}a_{j}^{i}$, the first $i$ is unbound because it is not in the scope of the second $\sum$. Hence, it is unrelated to the second $i$ : this expression depends on $i$ and is equal to $\sum_{j=i}^{n}\sum_{{\color{red}k}=1}^{n}a_{j}^{{\color{red}k}}$.
The sum of all elements above diagonal is $\sum_{i=1}^{n}\sum_{j=i}^{n}a_{j}^{i}$.