input: 
  from typing import List
  
  def exponential_series(x: int, n: int) -> int:
      """Given an integer x and a non-negative integer n, calculate the sum of the first 
      n terms of the exponential series generated by x.
      >>> exponential_series(2, 3)
      15
      >>> 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