From the first term and the common ratio, finds the nth term ar^(n−1) of a geometric sequence and the sum of the first n terms.