Prove that the number $\lfloor (2+\sqrt5)^{2019} \rfloor$ is not prime.
My approach for this went as follows:
Letting $a_n = (2+\sqrt5)^n +(2-\sqrt5)^n$ would result in $a_0 = 2$, $a_1=4$ and $a_2= 18$ from here it seems that we could prove by induction that all the terms $a_n$ are even. If that's the case we would have that $a_n$ is even and since $2-\sqrt5 < 1 \Rightarrow (2-\sqrt5)^n < 1 \Rightarrow$ $(2+\sqrt5)^n +(2-\sqrt5)^n = \lfloor (2+\sqrt5)^{2019} \rfloor$ this would imply that $\lfloor (2+\sqrt5)^{2019} \rfloor$ is even as well and hence not a prime.
However, I have a couple of questions regarding this. I'm not entirely sure if I can set $a_n = (2+\sqrt5)^n +(2-\sqrt5)^n$. The only reason why I did this was that in a similar problem I posted previously I got educated a bit and the reason was that this would result in $a_0, a_1$ and $a_2$ to be integers and from there I could find the recurrence relation. I'm not sure if this is the way to solve these problems in general.
Also it seems that from here I could deduce that instead of $a_n = (2+\sqrt5)^n +(2-\sqrt5)^n$ it should actually be $a_n=4a_{n-1}+a_{n-2}$ why is this the case?
That’s indeed the right way to do it, but you don’t need induction.
If you expand $$(2+\sqrt 5)^n + (2-\sqrt 5)^n$$ with the binomial theorem, any term with an odd power of $\sqrt 5$ cancels (so it’s integer), and any term with an even power of $\sqrt 5$ gets doubled (so it’s even).
With regards to the recurrence, the characteristic polynomial of that linear recurrence relation is $$x^2=4x+1,$$ which has roots $2 \pm \sqrt 5$, so it’s easily checked that it yields the same formula.