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?
 A: Yes, you are right. Another way to present it would be like so:
For $n$ odd,
$$7^n+1 \equiv (-1)^n+1 \equiv -1+1 \equiv 0 \pmod 8$$
and for $n$ even,
$$7^n+1 \equiv (-1)^n+1 \equiv 1+1 \equiv 2 \pmod 8$$
A: 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$.
A: 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.
