input: from typing import List
  
  
  def exponential_series(x: int, n: int) -> float:
      """Calculate the exponential series for a given integer x up to the nth term.
      >>> exponential_series(2, 4)
      31
      >>> exponential_series(3, 2)
      13
      """
      sum = 0
      for i in range(n + 1):
          sum += x ** i
      return sum
output:     sum = 0
      for i in range(n + 1):
          sum += x ** i
      return sum