There is the formula for the net present value which consists of a few variables and also of exponents.
Resolving to $K$, $C$, and $A_0$ is fairly simple. But is there a possibility to resolve to / solve for $n$?
The net present value formula:
$$K=-A_0+C\frac{(1+i)^n-1}{i(1+i)^n}$$
We'll use the fact that $\frac{x-1}{x} = 1 - \frac{1}{x}$ (it's just long division). Let's begin.
First add $A_0$ to both sides.
$$ K + A_0=C\frac{(1+i)^n-1}{i(1+i)^n} $$
Now multiply both sides by $\frac{i}{C}$.
$$ \frac{i}{C}(K + A_0)=\frac{(1+i)^n-1}{(1+i)^n} $$
Use the fact I mentioned at the start to break the fraction apart.
$$ \frac{i}{C}(K + A_0) = 1 - \frac{1}{(1+i)^n} $$
Now for three steps in one - subtract 1, multiply by -1, and take reciprocals.
$$ \left(1 - \frac{i}{C}(K + A_0)\right)^{-1} = (1+i)^n $$
Now for the final step. Take natural logarithms (or any log, doesn't matter), and do a last division. This gives
$$ \ln \left( \left(1 - \frac{i}{C}(K + A_0)\right)^{-1} \right) = n \ln (1+i) $$
or, simply
$$ \boxed{-\frac{ \ln \left(1 - \frac{i}{C}(K + A_0)\right)}{\ln (1+i)} = n.}$$
Note the minus sign out front, because of logarithm properties.