input: Write a function to perform linear regression on a given dataset and predict values using the trained model. Given two lists X and Y, the function should train a linear regression model and then predict the value of Y for a new value of X. If the input dataset is empty, return an empty list.
  assert linear_regression_predict([1,2,3,4,5], [3,5,7,9,13], 7)==[15.]
  assert linear_regression_predict([], [], 7)==[]
  assert linear_regression_predict([1,2,3], [2,4,6], 4)==[8.]
  assert linear_regression_predict([1,3,5], [3,9,15], 10)==[30.]
  assert linear_regression_predict([1,2,3], [3,5,7], 4)==[9.]
output: def linear_regression_predict(X, Y, new_X):
      if not X:
          return []
      n = len(X)
      sum_X = sum(X)
      sum_Y = sum(Y)
      sum_XY = sum(x * y for x, y in zip(X, Y))
      sum_X2 = sum(x ** 2 for x in X)
      slope = (n * sum_XY - sum_X * sum_Y) / (n * sum_X2 - sum_X ** 2)
      intercept = (sum_Y - slope * sum_X) / n
      return [slope * new_X + intercept]