4
$\begingroup$

Consider equation $(a+\sqrt{b})^n - (a-\sqrt{b})^n = x$

How do I properly solve for $n$ given $x$?

  • 0
    @WimC a,b,x integers, n can be decimal2012-12-12

2 Answers 2

3

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$

  • 0
    This was helpful, thank you2012-12-12
2

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.

  • 0
    @amWhy Using your link, I took the original equation to: $\sum_{k=0}^n {n\choose k}a^k\sqrt b^{n-k} - \sum_{k=0}^n {n\choose k}a^k(-\sqrt b)^{n-k} = x$ Not sure where to go from there? I get it down to: $\sum_{k=0}^n {n\choose k}a^k({\sqrt b}^{n-k}-{(-\sqrt b)}^{n-k})= x$2012-12-12