<s>[INST] How do I show that $\lfloor{(\sqrt 2+1)^{2020}}\rfloor\equiv 1\left(\text{mod}~ 4\right)$? I think I can use that $$(a\sqrt b+c)^{2n}+(a\sqrt b-c)^{2n}\in\mathbb{Z},$$ but I have no idea about the next step.
 [/INST] Expanding
Robert Israel's suggestion
(always a good thing to do):
If
$a_n
=u^n+v^n
$
then
$\begin{array}\\
a_n(u+v)
&=u^{n+1}+v^{n+1}+uv^n+vu^n\\
&=u^{n+1}+v^{n+1}+uv(v^{n-1}+u^{n-1})\\
&=a_{n+1}+uva_{n-1}\\
\end{array}
$
so
$a_{n+1}
=a_1a_n-uva_{n-1}
$.
If
$u = 1+\sqrt{2}$
and
$v = 1-\sqrt{2}
$
(trying
$u = \sqrt{2}+1,
v = \sqrt{2}-1$
doesn't work)
then
$uv = -1$
and
$u+v = 2$
so
$\begin{array}\\
a_{n+1}
&=2a_{n}+a_{n-1}\\
&=2(2a_{n-1}+a_{n-2})+a_{n-1}\\
&=5a_{n-1}+2a_{n-2}\\
&=5(2a_{n-2}+a_{n-3})+2a_{n-2}\\
&=12a_{n-2}+5a_{n-3}\\
\end{array}
$
so,
mod 4,
$a_{n+1}
=a_{n-3}
=a_{n+1-4k}
$
for $k \ge 0$.
Since
$a_0 = 2,
a_1 = 2,
a_2 = 6,
a_3 = 14
$,
we have
$\begin{array}\\
a_{2020}
&=a_{2020-4\cdot 505} \bmod 4\\
&=a_0 \bmod 4\\
&=2\\
\text{and}\\
u^{2020}
&=a_{2020}-v^{2020}\\
\text{so}\\
\lfloor u^{2020}\rfloor
&=\lfloor a_{2020}-v^{2020}\rfloor\\
&=a_{2020}-1
\qquad\text{since } 0 < v^{2020} < 1\\
&= 2-1  \bmod 4\\
&= 1 \bmod 4\\
\end{array}
$
</s>