input: Write a function to perform linear regression for predicting the numbers in a given dataset. The function should take two input lists, X and Y, representing the independent and dependent variables, respectively. The function should return the predicted value of Y for a given new X value.
  assert linear_regression(X = [1,2,3,4,5], Y = [3,5,7,9,13])==[17.]
  assert linear_regression(X = [6,7,8,9,10], Y = [15,18,22,27,33])==[40.]
  assert linear_regression(X = [2,4,6,8,10], Y = [4,8,12,16,20])==[25.]
  assert linear_regression(X = [1,3,5,7,9], Y = [1,9,25,49,81])==[121.]
  assert linear_regression(X = [10,11,12,13,14], Y = [100,121,144,169,196])==[225.]
output: def linear_regression(X, Y):
      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)
      
      m = (n * sum_xy - sum_x * sum_y) / (n * sum_x2 - sum_x ** 2)
      b = (sum_y - m * sum_x) / n
      
      new_x = X[-1] + 1
      predicted_y = m * new_x + b
      
      return [predicted_y]