Fuente TeX:
\displaystyle\  \sum_{i=0}^{n-1} \sum_{j=0}^{t_i-2} d(hor(a_{i,j}), hor(a_{i, j+1}))