input: Write a function to perform linear regression for predicting the numbers in a given dataset. The function should take two lists (X and Y) as input, where X is the input features and Y is the target values. The function should return the predicted value for a new input feature.
  assert perform_linear_regression([1,2,3,4,5], [3,5,7,9,13], 7) == 15.0
  assert perform_linear_regression([1,2,3,4,5], [3,5,7,9,13], 8) == 17.0
  assert perform_linear_regression([1,2,3,4,5], [3,5,7,9,13], 1) == 3.0
  assert perform_linear_regression([1,2,3,4,5], [3,5,7,9,13], 0) == 1.0
  assert perform_linear_regression([1,2,3,4,5], [3,5,7,9,13], 5) == 13.0
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