input: Write a function to perform linear regression on a given dataset and predict the value of y for a new value of x. The function should take two lists of numbers, X and Y, as input, and return the predicted value of y for a new value of x.
  assert linear_regression([1,2,3,4,5], [3,5,7,9,13], 7)==array([15.])
output: def linear_regression(X, Y, 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_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
      
      return m * x + b