Consider equation $(a+\sqrt{b})^n - (a-\sqrt{b})^n = x$
How do I properly solve for $n$ given $x$?
Consider equation $(a+\sqrt{b})^n - (a-\sqrt{b})^n = x$
How do I properly solve for $n$ given $x$?
There are many approaches. If you think $n$ is a small whole number, you can just try a range. A spreadsheet would make this easy. If one of $a+\sqrt b$ or $a-\sqrt b$ is smaller than $1$ it will to to zero as $n$ increases. To be definite, assume $a-\sqrt b$ is smaller than $1$. Let's ignore it for a moment. Then $n \approx \frac {\log x}{\log (a+\sqrt b)}$ where you can use your favorite base for the logs. You can use numerical methods. The left side will be monotonic with $n$, so any reasonable root-finder will work. Just graphing will get you very close.
As an example, suppose you want to find the index of a Fibonacci number. We are given that $\sqrt 5 F_n=(\frac {1+\sqrt 5}2)^n-(\frac {1-\sqrt 5}2)^n$. As $|\frac {1-\sqrt 5}2|\lt 1$, powers of it go to zero quickly. If somebody gives us $14930352$ and asks which number it is, we can just do $\frac {\log (14930352\sqrt 5)}{\log (\frac {1+\sqrt 5}2)}$ and get a number that is within $10^{-14}$ of $36$, so $n=36$
Consider equation $(a+\sqrt{b})^n - (a-\sqrt{b})^n = x$
Consult this link: The Binomial Theorem.
Since you are given $x$ (taken to be a constant), you can also try take logarithms of each side of the equation.