We can do some algebra to make a formula for the value of geometric series:
Sn = r^0 + r^1 + r^2 + r^3 + r^4 + … + r^n
This is a series (named Sn) with n terms and a base r. Multiply both sides by r:
rSn = r^1 + r^2 + r^3 + r^4 + r^5 + … + r^(n+1)
Now consider Sn - rSn regardless of the value of n most of the terms will cancel out:
Sn - rSn = r^0 - r^(n+1)
Now solve for Sn:
Sn(1 - r) = 1 - r^(n+1)
Sn = [1 - r^(n+1)]/(1-r)
Since r<1 if n goes to infinity r^(n+1) will go to zero: