Suppose I have a simple equation with indices, like the one shown in the image. How can I use Mathematica to implement it? I am aware of summing when a specific variable changes value of some range, but the stated problem is different. Here the index references to a location in a list, and the value in that list can be many things.
Converting comment into an answer:
Sum[((n[[j]] - 1) Nmax)/n[[j]], {j, i, Nmax}]
, where n is a list with at least Nmax elements.
If n
is you list, more elegant than Sum
:
Total[1 - 1 / n] Length[n]
Nmax Total[1 - 1/n]
? $\endgroup$ – Henrik Schumacher Aug 23 '19 at 14:35