input: Write a function to perform linear regression on a given dataset and predict the output for a new input value. The function should take two lists X and Y as inputs, where X is a list of input features and Y is a list of corresponding output values. The function should return the predicted value for a new input.
  assert perform_linear_regression([1,2,3,4,5], [3,5,7,9,13], 7)==17.0
  assert perform_linear_regression([0,1,2,3,4], [1,3,5,7,9], 5)==11.0
  assert perform_linear_regression([10,20,30,40,50], [35,55,75,95,115], 60)==135.0
  assert perform_linear_regression([-1,-2,-3,-4,-5], [-4,-6,-8,-10,-12], -6)==-14.0
  assert perform_linear_regression([1.5,2.5,3.5,4.5,5.5], [4.5,6.5,8.5,10.5,14.5], 6.5)==16.5
output: def perform_linear_regression(X, Y, new_input):
      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_input + intercept