def sum_gp(a,n,r):
 import math
 
 total = (a * (1 - math.pow(r, n ))) / (1- r)
 return total
def sum_gp(a, n, r):
    import math
    _i_1 = 0
    if _i_1 > _i_1:
        return total
   
    total = (a * (1 - math.pow(r, n))) / (1 - r)
    return total