What can be said about the integral part of $(a+\sqrt{b})^n $ If an irrational number of the form $a+\sqrt{b}$ is raised to the power $n$, with $a, b \in \mathbb{Z}$, and $n \in \mathbb{N}$, what can be said about the integral part of the resulting number? For instance, is it an even number? If yes what are the conditions on $n$? If odd, what are the conditions?
I think I should start from considering $(a+\sqrt{b})^n= p+q$ where p is an integer and q is a proper fraction. I don't know how to proceed further. Please help. And also suggest a website that can give more of such properties.
 A: Another approach to the case of $0 < (a-\sqrt b) < 1$:
If $0<f<1$ and $r+f \in \Bbb Z$ for some $r \in \Bbb R$, then $r+f =\left\lfloor r+1 \right\rfloor $.
$(a+\sqrt b)^n + (a - \sqrt b)^n \in \Bbb Z$ by the binomial theorem and is the integral part of $(a+\sqrt b)^n +1$. It is clearly always even and the required quantity is odd.
If $-1 <f = (a-\sqrt b) < 0$, then $r+f \in \Bbb Z$ means that $r+f = \left\lfloor  r \right\rfloor $. Now, $$\left\lfloor (a+\sqrt b)^n \right\rfloor = (a+\sqrt b)^n + (a - \sqrt b)^n$$ and has the opposite parity of n.
This is because $f^n$ alternates from positive to negative( that is, from the first case to second case).
A: I will assume that $b$ is not a perfect square.
In the case that $|a-\sqrt{b}|\lt1$, this can be answered using sequences satisfying a Linear Recurrence. Both $(a+\sqrt{b})^n$ and $(a-\sqrt{b})^n$ satisfy the linear recurrence
$$
u_n=2au_{n-1}+(b-a^2)u_{n-2}\tag{1}
$$
Therefore, $u_n=(a+\sqrt{b})^n+(a-\sqrt{b})^n$ also satisfies $(1)$. Furthermore, $u_0=2$ and $u_1=2a$. Thus, according to $(1)$ $u_n$ is always an even integer and $|(a-\sqrt{b})^n|\lt1$ tends to $0$.
Thus, if $n$ is even or $a^2\gt b$,
$$
\left\lfloor(a+\sqrt{b})^n\right\rfloor=u_n-1\text{ is odd}\tag{2}
$$
If $n$ is odd and $a^2\lt b$,
$$
\left\lfloor(a+\sqrt{b})^n\right\rfloor=u_n\text{ is even}\tag{3}
$$
A: If $0 < a - \sqrt{b} < 1$, then
$$\left\lfloor\left(a + \sqrt{b}\right)^n\right\rfloor = 2 \left(\begin{bmatrix} a & b \\ 1 & a \end{bmatrix}^n\right)_{1,1} - 1$$
(Eigenvalue decomposition shows why.)
So if you want to ask "is this even", then the answer is "never"...it is 1 less than an even number.
You can also do the matrix computations $\pmod m$ , for example $m=10^z$, to find the last $z$ digits.
