If $a$ is any integer and $n$ is divisible by $d$, then $a^n-1$ is divisible by $a^d-1$.
Is it valid to solve this using Fermat's? Saying that since $d|n$, $n=ad$ for some integer $a$. Then $a^n-1=a^{ad}-1$ and $a^d \equiv 1 (\mod d+1)$ so $a^{ad}-1 \equiv 0 (\mod d+1)$. Also, $a^d-1\equiv 0 (\mod d+1)$. Is this valid for the question? I am hesitant because I used the specific scenario of $\mod d+1$. Also does them both being $0$ mean that they divide each other... Thank you.