Write a function to find the sum of geometric progression series.
import math
def sum_gp(a,n,r):
 total = (a * (1 - math.pow(r, n ))) / (1- r)
 return total
<s>[INST]<<SYS>>Given a task and its code, generate test cases for the code.<</SYS>>Write a function to find the sum of geometric progression series.
import math
def sum_gp(a,n,r):
 total = (a * (1 - math.pow(r, n ))) / (1- r)
 return total[/INST]assert sum_gp(1,5,2)==31
assert sum_gp(1,5,4)==341
assert sum_gp(2,6,3)==728</s>