<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] Just to be different:
$(a-1)(a^{n-1} + a^{n-2} + ..... + a + 1)=(a^n - 1)$.
$(a+1)(a^{n-1} -a^{n-2} + ........ \mp a \pm 1) = (a^n \pm 1)$.
with $n$ even yielding $(a+1)(a^{n-1} -a^{n-2} + ........ + a - 1)=a^n -1$
and $n$ odd yielding $(a+1)(a^{n-1} -a^{n-2} + ...... -a +1) = a^n+1$
So we $a = 7$ we get $7+1=8|a^n+1$ if $n$ is odd.  And $7+1=8|a^n-1$ if $n$ is even.  And as $a^n-1 = (a^n -1) + 2$, $a^n + 1$ will have remainder $2$ if $n$ is even.
But that's just to be different.
What you did was shorter and better.  This just shows why it's no surprise.
</s>