Question: 
Write a function to find the sum of geometric progression series.


Model's Code:
def sum_gp(a, r, n):
    if r == 1:
        return a * n
    return a * (1 - r**n) // (1 - r)



Sample Correct Code:
import math
def sum_gp(a,n,r):
 total = (a * (1 - math.pow(r, n ))) / (1- r)
 return total


Asserts:
assert sum_gp(1,5,2)==31
assert sum_gp(1,5,4)==341
assert sum_gp(2,6,3)==728


Tests:
Test 1 of 3: FAIL: AssertionError()

Test 491 of 974: 361/491 (73.5234215885947%): failed