The sum of the geometric series

r^{0} + r^{1} + r^{2} + ... + r^{n-1}

In the case where r ≠ 1, simplifies to (r^{n} - 1) / (r - 1). If r < 1, this sum is bounded from above by 1 / (1 - r).

If r = 1, this sum is rn.