input: Write a function to perform linear regression for predicting the numbers in a given dataset. The function should take two lists as input, X and Y, and return the predicted value for a new X value.
  
  assert perform_linear_regression([1,2,3,4,5], [3,5,7,9,13], 7)==13.5
  assert perform_linear_regression([1,2,3,4,5], [3,5,7,9,13], 6)==11.5
  assert perform_linear_regression([1,2,3,4,5], [3,5,7,9,13], 8)==15.5
output: def perform_linear_regression(X, Y, new_X):
      n = len(X)
      sum_X = sum(X)
      sum_Y = sum(Y)
      sum_XY = sum(x * y for x, y in zip(X, Y))
      sum_X_squared = sum(x ** 2 for x in X)
      
      slope = (n * sum_XY - sum_X * sum_Y) / (n * sum_X_squared - sum_X ** 2)
      intercept = (sum_Y - slope * sum_X) / n
      
      return slope * new_X + intercept