Given a s and the amount of terms n, is it possible to find the common ratio of a finite geometric series?
$$\sum_{i=1}^n r^i = s$$
I've been able to solve the equation up to
$$\frac{r^{n+1} - r}{r-1} = s$$
but I have no idea how to reduce this further an a way a computer can understand. The closest answer(Geometric series : Find common ration 'r') I can find is to approximate the solution to $$r^n=s$$ But this number is way to inaccurate for my use case. Since wolfram alpha seems to be able to solve these types of problems, I am hoping there is some simple formula I can use to get the answer I need or at least a better approximation.