The proof that the formula Sn=(a(1-rn))/(1-r) sums n terms of a geometric series is as follows, where r is the ratio of the series (which is between -1 and 1) and a is the first term in the series.

Sn=ar0+ar1+ar2+...+arn-2+arn-1
(r)Sn=r(ar0+ar1+ar2+...+arn-1)
r*Sn=ar1+ar2+ar3+...+arn-1+arn
a+r*Sn=a+ar1+ar2+ar3+...+arn-1+arn
a+r*Sn=Sn+arn
Sn-r*Sn=a-arn
Sn(1-r)=a(1-rn
Sn=(a(1-rn))/(1-r)