As title says:
$$A^N - B^N = C,$$ $A,B,C$ are known, solve for $N$. This is substracted from a bigger formula where this N is one of the parameters to be calculated.
I have tried it with: $$X = A^Y \Rightarrow Y=\frac{\log(X)}{\log(A)}.$$ But this doesnt work for this version. I have been stuck on in for 8 hours already and a solution would really help me out. By calculating it by myself I tried the following: $A = 5$, $B = 2$.
For $C = 3$, $N = 1$.
For $C = 21$, $N = 2$.
For $C = 117$, $N = 3$.
But that's with simply filling in $N$. Which is not allowed since I need to find it by a algorithm/formula for a vision project.
Sorry for duplicate.
You won't find a nice algebraic formula for general parameters. It looks like you are restricting $A,B,C,N$ to natural numbers-are you? You can do pretty well by ignoring the $B$ term to start, so take your first try to be $N=\left \lceil \frac {\log C}{\log A}\right \rceil$ then just count upward for $N$ until you find the one that is right. If you don't restrict $N$ to naturals, you want a one dimensional root finder. You have a good first guess (take off the ceilings).
Added: for a very simple approach in the reals, not as fast as Newton-Raphson but easy to program, take $N_0=\frac{\log C}{\log A}$, then $N_{i+1}=\frac {\log C-B^{N_i}}{\log A}$ and iterate to convergence. If $N$ is reasonably large $B^N$ will be well less than $A^N$ this should converge nicely.