TeX source:
S_{n}=\sum_{i=1}^{N} R\left(t_{i-1}, t_{i}\right)