<s>[INST] Prove $\left \lfloor \frac{1}2 \left( 2+\sqrt3 \right) ^{2002} \right\rfloor \equiv -1 \pmod7 $ Prove
$$ \large \left\lfloor \frac{1}2 \left( 2+\sqrt3 \right) ^{2002} \right\rfloor \equiv -1 \pmod7 $$
So far my intuion only tells me that this has something to do with $(2+\sqrt3)(2-\sqrt3)=1$, but I don't even know where to begin.
I'm looking for elegant solution.
 [/INST] $$(2+\sqrt 3)^2=7+2\sqrt3$$
Now, $$(7+4\sqrt3)^{2m+1}+(7-4\sqrt3)^{2m+1}$$
$$=2\left(7^{2m+1}+\binom {2m+1}27^{2m-1}\cdot4^2\cdot3+\binom{2m+1}47^{2m-3}\cdot4^4\cdot3^2+\cdots+\binom{2m+1}{2m}7\cdot4^{2m}\cdot3^m\right)$$ which is divisible by $2\cdot 7=14.$
Consequently, $$\frac12(7+4\sqrt3)^{2m+1}+\frac12(7-4\sqrt3)^{2m+1}\equiv0\pmod 7$$
Like  Mathlover has observed,  $0<\frac{7-4\sqrt3}2=\frac{7^2-(4\sqrt3)^2}{2(7+4\sqrt3)}<1\implies 0<\frac12(7-4\sqrt3)^{2m+1}<1$
Hence, $$7k-1<\frac12(7+4\sqrt3)^{2m+1}<7k$$ some integer $k.$
</s>