Compute the n-th term of a geometric sequence from first term, ratio and n.
輸入首項 a₁、公比 r 與項數 n,求第 n 項。