A.12.D: Write a formula for the nth term of arithmetic and geometric sequences, given the value of several of their terms.