Find $b$ when $(2+\sqrt{3})^n=5042+b\sqrt{3}$ Find $b$ when $(2+\sqrt{3})^n=5042+b\sqrt{3}$
I saw that $n$ cannot be bigger than $11$ because then the rational part is going to be bigger than $5024$. But I don't know how to find the $n$ exactly and how to find out $b$ then. Any hints?
Note: $b$ and $n$ are integers.
 A: Note that $2+\sqrt{3}$ is a root of $x^2-4x+1$. Therefore the sequences $(a_n)$ and $(b_n)$ defined by
$$(2+\sqrt{3})^n=a_n+b_n\sqrt{3}$$
will both satisfy
$$a_n=4a_{n-1}-a_{n-2}\qquad \qquad b_n=4b_{n-1}-b_{n-2}$$
with initial values, of course, given by
$$\begin{align*}
(2+\sqrt{3})^0=1+0\sqrt{3}&\; \implies \; a_0=1,\quad b_0=0\\
(2+\sqrt{3})^1=2+1\sqrt{3}&\; \implies \; a_1=2,\quad b_1=1
\end{align*}$$
You're told that
$$(2+\sqrt{3})^n=a_n+b_n\sqrt{3}=5042+b\sqrt{3}$$
for some $n$, and asked to find $b$. To do this, you just need to find the value of $n$ for which $a_n=5042$, and then compute the corresponding value of $b_n$. 
Given the recurrences and initial values, you can of course now use brute force on the sequence $a_n$, computing higher and higher values 
$$a_0 = 1,\qquad a_1 = 2,\qquad a_2=7,\qquad a_3=26,\qquad a_4=97,\qquad \ldots$$
until you find the $n$ that gives you $5042$, at which point you would then compute $b_n$ for that $n$, and be done.

However, it may be useful to have an alternative approach, e.g. if you were told to find the value of $n$ for which $$a_n=19785515999613069781581367687$$
you may prefer to skip the tedious calculations.
Note that the other root of $x^2-4x+1$ is $2-\sqrt{3}$, so both $(a_n)$ and $(b_n)$ will satisfy
$$\begin{align*}
a_n&=A_0(2+\sqrt{3})^n+A_1(2-\sqrt{3})^n\\
b_n&=B_0(2+\sqrt{3})^n+B_1(2-\sqrt{3})^n
\end{align*}$$
for some numbers $A_0,A_1,B_0,B_1$, which you can deduce using the initial values of $a_0,a_1,b_0,b_1$.
Note that $|2-\sqrt{3}|<1$ so the contribution from that term to the overall value of $a_n$ becomes negligible for large $n$. Therefore $a_n\approx A_0(2+\sqrt{3})^n$ for large $n$, so 
$$n\approx\log_{2+\sqrt{3}}(a_n/A_0)=\frac{\log(a_n)-\log(A_0)}{\log(2+\sqrt{3})}$$
You can then plug in and check the value of $a_n$ for integers close to this value to find the exact $n$.
A: First note that
$(2+\sqrt{3})^n = a+b\sqrt{3}$
with $a,b$ both positive whole  for any positive whole number $n$. There is also a conjugate relation
$(2-\sqrt{3})^n = a-b\sqrt{3}$
and then we have the product of these two relations
$1 = a^2-3b^2$
For any positive whole number $n$ the product relation implies that $b$ is the largest whole number less than $a/\sqrt{3}$.  So punch that quotient into your calculator with the given value of $a$ and read off the whole-number part.
