input: Write a python function to find the number of unique triplets (i, j, k) in a list where the difference between consecutive elements is the same.
  assert function([1, 2, 3, 4, 5, 6]) == 4
  assert function([10, 20, 30, 40]) == 1
  assert function([1, 3, 5, 7, 9]) == 3
  assert function([5, 10, 15, 20, 25]) == 3
output: def function(arr):
      n = len(arr)
      count = 0
      for i in range(n-2):
          for j in range(i+1, n-1):
              for k in range(j+1, n):
                  if arr[j] - arr[i] == arr[k] - arr[j]:
                      count += 1
      return count