input: def exponential_series(x: int, n: int) -> int:
      """
      Calculate the sum of the exponential series from 0 to n with base x.
  
      >>> exponential_series(2, 3)
      15
      >>> exponential_series(3, 2)
      13
      """
output:     result = 0
      for i in range(n + 1):
          result += x ** i
      return result