Solving for common ratio and first term