Skip to main content
2 of 5
Spelling
MarcoB
  • 67.7k
  • 18
  • 96
  • 198

Summation over list elements

As we know, one of the simplest way to do a summation (with special intervals) over list elements is using

Sum[list[[i]], {i, 3, 8, 2 }] (*with steps of 2*)

for a list such as list={a,b,c,d,e,f,g,h,i,j,k,l} which returns c+e+g.

How can we use Replacelist or FoldList to this aim?

Unbelievable
  • 4.9k
  • 1
  • 21
  • 47