finding the sum of geometric progressions formula