Generate a python code to find the sum of the n terms of a series given the first term and the common ratio
[a, r], n
def find_sum_series(a, r, n):
    sum = 0
    for i in range(1, n + 1):
        sum = sum + a*(r**(i - 1))
    return sum