def telescopic_direct(L, R, n, limits):
 (i, a, b) = limits
 s = 0
 for m in range(n):
  s += (L.subs(i, (a + m)) + R.subs(i, (b - m)))
 return s

def telescopic_direct ( L , R , n , limits ) : ( i , a , b ) = limits s = 0 for m in range ( n ) : s += ( L . subs ( i , ( a + m ) ) + R . subs ( i , ( b - m ) ) ) return s
returns the direct summation of the terms of a telescopic sum l is the term with lower index r is the term with higher index n difference between the indexes of l and r for example: .