From the answers to this question, I learned that the recommended way to construct a symbolic sum of terms in an expression is to use Array.
But I'm having a little trouble creating a non-rectangular array with it. For example, how do I emulate something like
Table[f[i,j],{i,1,5},{j,i,5}]
Sum[f[i,j],{i,1,5},{j,i,5}]
which have pyramidal forms?
Is Array simply inflexible about the shape of the output. If so, what is the recommended method to construct a non-rectangular array?
I suppose I can nest Array like so:
Array[Function[{i}, Array[f[i, #] &, 6 - i, i, Plus]], 5, 1, Plus]
But I have to use a named function with argument i in order for it to work. Is it possible to achieve the same result using anonymous functions only?
Array[If[#2 >= #1,f[#1,#2],Nothing]&,{5,5}]. it seems to work. Maybe stupid. – andre314 Jul 10 '18 at 16:46