Caculates geometric sums and partial sums