How to change summation in the sum $$ \sum_{i=0}^n \left(\sum_{j=1}^i \sum_{k=j}^i b_{j,k} \right) a_i? $$
For $n=4$ we have $$ \sum_{i=0}^4 \left(\sum_{j=1}^i \sum_{k=j}^i b_{j,k} \right) a_i=f_{{1,1}}a_{{1}}+a_{{2}} \left( f_{{1,1}}+f_{{1,2}}+f_{{2,2}} \right) +a_{{3}} \left( f_{{1,1}}+f_{{1,2}}+f_{{1,3}}+f_{{2,2}}+f_{{2,3}}+f_{{ 3,3}} \right) +a_{{4}} \left( f_{{1,1}}+f_{{1,2}}+f_{{1,3}}+f_{{1,4}}+ f_{{2,2}}+f_{{2,3}}+f_{{2,4}}+f_{{3,3}}+f_{{3,4}}+f_{{4,4}} \right)=f_{{1,1}} \left( a_{{1}}+a_{{2}}+a_{{3}}+a_{{4}} \right) +f_{{2,2}} \left( a_{{2}}+a_{{3}}+a_{{4}} \right) +f_{{3,3}} \left( a_{{3}}+a_{{ 4}} \right) +f_{{4,4}}a_{{4}}+f_{{2,1}}a_{{2}}+a_{{3}} \left( f_{{2,1} }+f_{{3,1}}+f_{{3,2}} \right) +a_{{4}} \left( f_{{2,1}}+f_{{3,1}}+f_{{ 4,1}}+f_{{3,2}}+f_{{4,2}}+f_{{4,3}} \right) $$I guess it must be something like that $$ \sum_{i=0}^n \left(\sum_{j=1}^i \sum_{k=j}^i b_{j,k} \right) a_i=\sum_{j=1}^n \sum_{k=j}^? \left(\sum_{i=?}^? a_i \right) b_{j,k} $$ but can't find true limits. Any ideas?
It is helpful to write the range of summation in terms of inequalities. In your case it turns out to be $$\begin{align}0 &\leq i \leq n\\ 1&\leq j\leq i\\ j&\leq k\leq i\end{align}\tag{1}$$ and you can check that this is equivalent to $$1\leq j \leq k \leq i \leq n.\tag{2}$$ Notice that the original order of indices is $(i,j,k)$ and take a look at $(1)$. In the first line $i$ "doesn't know about" $j$ or $k$, so it is just $1\leq i \leq n$ ($i = 0$ doesn't actually appear in the sum). In the second line, $j$ "doesn't know about" $k$, but it "does know" $i$, so it is $1\leq j \leq i$. Finally, $k$ "knows everyone", so the third line becomes $j\leq k\leq i$.
Let us now change the order to $(j,k,i)$. From $(2)$ we read that the first line has to be $1\leq j\leq n$ since $j$ "doesn't know about" $k$ and $i$. The second line is $j\leq k \leq n$ since $k$ "doesn't know" $i$, but "knows" $j$. Finally, the third line is $k\leq i\leq n$ since $i$ "knows everyone".
Thus, the change of order of summation you want is $$\sum_{j=1}^n\sum_{k=j}^n\sum_{i=k}^n$$