Finding the sum of a geometric sequence