Prove that if $p$ is an odd prime, then $$p\mid \lfloor(2+\sqrt5)^p\rfloor - 2^{p+1}$$
The solution posted by another user is as follows:
Let $=(2+\sqrt5)^p + (2-\sqrt5)^$. Note that $N$ is an integer. There are various ways to see this. One can, for example, expand using the binomial theorem, and observe that the terms involving odd powers of $\sqrt5$ cancel.
Because $(2−\sqrt5)^$ is a negative number close to $0$, it follows that $=⌊(2+\sqrt5)^⌋$.
In the two binomial expansions, all the binomial coefficients $\binom{p}{k}$ apart from the first and last are divisible by $p$. The first term in each expansion is $2^p$. We conclude that $N\equiv 2\cdot 2^p\pmod{p}$, and the result follows.
Could someone explain this proof in more detail please? I don't understand the following:
1) How the odd powers of $\sqrt5$ cancel,
2) How $N=\lfloor(2+\sqrt5)^p\rfloor$ (I understand that $(2-\sqrt5)^p$ is negative),
3) How $N\equiv 2\cdot 2^p\pmod{p}$, and the result follows.
How would one go about generalising to a result about $p^n$?
Thanks
For 1), the sum of odd powers $a^n + b^n$ can be factored into $(a+b)(a^{n-1}-a^{n-2}b+a^{n-3}b^2..........+b^{n-1})$ so where binomials $a$ and $b$ contain the same negative and positive irrational, these two factors will always be integers as positive and negative quantities of the irrational will be equal.
Example: $(2+\sqrt 5)^3 + (2 - \sqrt 5)^3 = (2+\sqrt 5+2 - \sqrt 5)((4 + 4\sqrt 5 + 5) - (4 - 5) + (4 - 4\sqrt 5 + 5)) = 4(19) = 76$