Sum of terms in a geometric progression