nth term and partial sum of arithmetic and geometric sequences.
arithmetic_seq(2, 5, 10)
geometric_seq(3, 2, 8)
geometric_seq(1, 1/2, 3)