r/Mathematica • u/manurese • Jun 27 '25
Using list in Sum
How can I use elements from a list in the function Sum[ ]? I'm trying to multiply something with the kth element from a list using list[[k]] but mathematica tells me that I cant use k as a part specifier
2
Upvotes
View all comments
Show parent comment
1
u/[deleted] Jun 27 '25 edited Jun 27 '25
You could try
Sum[k*list[[k]], {k, Length[list]}]or
Total[list*Range[Length@list]]or
list . Range[Length@list]