Finding the number of terms and common ratio