input: Write a function to perform linear regression for predicting the numbers in a given dataset. The function should take two lists of numbers, X and Y, where X is the input dataset and Y is the corresponding output dataset. The function should train a linear regression model on the provided data and return the predicted value for a given input.
  assert linear_regression([1,2,3,4,5], [3,5,7,9,13], 7)==[15]
  assert linear_regression([2,4,6], [4,8,12], 8)==[16]
  assert linear_regression([0,1,2,3], [2,4,6,8], 4)==[10]
  assert linear_regression([3,6,9], [9,18,27], 12)==[36]
  assert linear_regression([5], [10], 10)==[20]
output: def linear_regression(X, Y, input_value):
      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)
      
      m = (n * sum_xy - sum_x * sum_y) / (n * sum_x_squared - sum_x ** 2)
      b = (sum_y - m * sum_x) / n
      
      predicted_value = m * input_value + b
      return [predicted_value]