Summation of values with odd index in a sequence

1.6k Views Asked by At

Given a sequence of numbers $S = \langle s_1,\dots,s_n \rangle$ I want to sum all the elements of S that the index is odd.

Would the following be a good notation or is there a more compact (and better) way to write that? $\sum_{i=0,i \in 2\mathbb{N}-1}^{|S|} s_i$

Thanks!

2

There are 2 best solutions below

1
On

How about $\displaystyle \sum_{i=0}^{\lfloor\frac{n-1}{2}\rfloor} s_{2i+1}$?

1
On

I think $i=0,i\in 2\mathbb N$ looks confusing. Better might be $ \displaystyle \sum_{{i=0} \atop {i \ \text{even}}}^n s_i $ or $\displaystyle\sum_{{i=0} \atop {i \ \text{odd}}}^n s_i $