input: Write a python function to calculate the total of a geometric series.
  assert sum_gp(1,5,2)==31
  assert sum_gp(1,5,4)==341
  assert sum_gp(2,6,3)==728
output: def sum_gp(a, n, r):
      return a * (r ** n - 1) // (r - 1)