input: Write a function to perform linear regression for predicting the numbers in a given dataset. The function should take two lists as input: the first list represents the independent variable X, and the second list represents the dependent variable Y. The function should then train a linear regression model on these lists and return the predicted value for a new input. If the input lists are empty, the function should return None.
  
  assert linear_regression([1,2,3,4,5], [3,5,7,9,13])==[15.0]
  assert linear_regression([], [])==None
  
  import numpy as np
  from sklearn.linear_model import LinearRegression
  
  def linear_regression(X_list, Y_list):
      if not X_list or not Y_list:
          return None
      
      X = np.array(X_list).reshape(-1,1)
      Y = np.array(Y_list)
      
      model = LinearRegression()
      model.fit(X, Y)
      
      # Predicts the value of y for the next number in the sequence
      prediction = model.predict([[X_list[-1] + 1]])
      return prediction.tolist()
output: 
  import numpy as np
  from sklearn.linear_model import LinearRegression
  
  def linear_regression(X_list, Y_list):
      if not X_list or not Y_list:
          return None
      
      X = np.array(X_list).reshape(-1,1)
      Y = np.array(Y_list)
      
      model = LinearRegression()
      model.fit(X, Y)
      
      # Predicts the value of y for the next number in the sequence
      prediction = model.predict([[X_list[-1] + 1]])
      return prediction.tolist()
  