Calculate the nth term of a geometric sequence from the first term and common ratio.
Category: Education.