<s>[INST] Prove that the number $7^n+1$ is divisible by $8$ if $n$ is odd. In the case where $n$ is even, give the remainder of the division of $7^n+1$ by $8$. 
Prove that the number $7^n+1$ is divisible by $8$ if $n$ is odd. In the case where $n$ is even, give the remainder of the division of $7^n+1$ by $8$.



*

*If $n$ is odd


$7 \equiv -1 \mod 8$
$7^n \equiv (-1)^n \mod 8$
$7^n \equiv -1 \mod 8$
$7^n +1 \equiv 0 \mod 8$
Therefore, $7^n+1$ is divisible by $8$ if $n$ is odd.


*

*If $n$ is even


$7 \equiv -1 \mod 8$
$7^n \equiv (-1)^n \mod 8$
$7^n \equiv 1 \mod 8$
$7^n +1 \equiv 2 \mod 8$
Therefore, the remainder of the division of $7^n+1$ is $2$.
Is that true, please?
 [/INST] Note that
$\forall n \in \Bbb N, \; 7^n + 1 = (8 - 1)^n + 1 = \displaystyle \sum_0^n \dfrac{n!}{k!(n - k)!}8^{n - k}(-1)^k + 1 = \sum_0^{n - 1} \dfrac{n!}{k!(n - k)!}8^{n - k}(-1)^k + (-1)^n + 1  , \tag 1$
via the binomial theorem; when $n$ is odd this yields
$7^n + 1 = \displaystyle  8\sum_0^{n - 1} \dfrac{n!}{k!(n - k)!}8^{n - k - 1}(-1)^k  , \tag 2$
whence
$8 \mid 7^n + 1, \; \text{odd} \; n; \tag 3$
for even $n$ we obtain
$7^n + 1 = \displaystyle  8\sum_0^{n - 1} \dfrac{n!}{k!(n - k)!}8^{n - k - 1}(-1)^k + 2; \tag 4$
we note that 
$0 \le 2 < 8; \tag 5$
that is, the remainder of $7^n + 1$ when divided by $8$ is $2$.
</s>