<s>[INST] How do I prove that $\dfrac{(7+\sqrt{48})^n+(7-\sqrt{48})^n}{2}\equiv3\pmod4$ if and only if $n$ is odd? How do I prove that $\dfrac{(7+\sqrt{48})^n+(7-\sqrt{48})^n}{2}\equiv3\pmod4$ if and only if $n$ is odd?
I know that it will always be whole, and that it will never be $\equiv3$ if $n$ is even. But I want to know how to prove that it will always be $\equiv3$ if $n$ is odd...
 [/INST] $(a \pm b)^n = a^n \pm n*a^{n-1}b + ...... + (-1)^i*{n \choose i}a^ib^{n-1}+ ....$.
So $(a -b)^n + (a+ b)^n = 2a^n + (n - n)a^{n-1}b + ...... (1 + (-1)^i){n \choose i}a^ib^{n-1}+....$.
$1 + (-1)^i = 0$ if $i$ is odd; $2$ if $i$ is even.
so $(a -b)^n + (a+ b)^n = 2(a^n + {n \choose 2}a^{n-2}b^2 + ...... {n \choose 2k}a^{n-2k}b^{2k}+....)$
So $N= \frac{(7 + \sqrt{48})^n + (7-\sqrt{48})}{2}= \sum_{k = 0;k \le n/2} {n \choose 2k}7^{n-2k}\sqrt{48}^{2k} = \sum_{k = 0;k \le n/2} {n \choose 2k}7^{n-2k}48^k$.
${n \choose 2k}7^{n-2k}48^k \equiv 0 \mod 4$ if $k \ne 0$. (Because $48\equiv 0 \mod 4$).
So $N= \sum_{k = 0;k \le n/2} {n \choose 2k}7^{n-2k}48^k \equiv {n \choose 0}7^n*48^0 = 7^n \equiv (-1)^n \mod 4$.
If $n$ is even $N \equiv (-1)^n \equiv 1 \not \equiv 3 \mod 4$.
If $n$ is odd $N \equiv (-1)^n \equiv -1 \equiv 3 \mod 4$
</s>