sum (i = 1 to n) ar^i