Simple divisibility problem 
Suppose $a$ and $b$ are distinct integers and $n\mid a^n-b^n$. Prove that $n\mid\frac{a^n-b^n}{a-b}$.

Here is how I do it: Write $a=b+d$, then $a^n-b^n=(b+d)^n-b^n=\binom{n}{1}b^{n-1}d+\binom{n}{2}b^{n-2}d^2+ \cdots + \binom{n}{n-1}bd^{n-1}+d^n \equiv 0 \pmod{n}$. Since $n| \binom{n}{k}$ for $k=1,2,\cdots,n-1$, $n|d^n$, which implies $n|d^{n-1}$. Therefore $(a^n-b^n)/(a-b)=\binom{n}{1}b^{n-1}+\binom{n}{2}b^{n-2}d+ \cdots + \binom{n}{n-1}bd^{n-2}+d^{n-1} \equiv 0 \pmod{n}$ and we are done. I wanna ask why $n|d^n$ will implies $n|d^{n-1}$ and that if there are any other possible solutions, thanks in advance.
 A: We will repeatedly use the trick that if $n=xy$, then $a^n$ is also an $x$th power.
We will approach this by first showing it is true for prime powers.
Base case: $p$ is a prime and $p | a^p - b^p$. Then, we have $a \equiv a^p \equiv b ^p \equiv b \pmod{p}$, and hence $\frac{a^p - b^p}{a-b} \equiv p a^{p-1} \equiv 0 \pmod{p}$.
If $p^{k} | a^{p^k} - b^{p^k}$, then $p \mid \frac{ a^{p^i} - b^{p^i}} { a^{p^{i-1}}-b^{p^{i-1}}}$ for all values of $i$, and hence if you take the product of all these terms (which telescope), $p^k | \frac{a^{p^k} - b^{p^k}}{a-b}$.
Now, we will show that if $p^k || n$, and $n| a^n-b^n$, then $p^k | \frac{a^n-b^n}{a-b}$.
Set $n = p^k \alpha$. Then, $p^k | (a^\alpha) ^{p^k} - (b^\alpha)^{p^k}$, and applying the above we get $p^k | \frac{ (a^\alpha) ^{p^k} - (b^\alpha)^{p^k}} { a^\alpha - b^\alpha}$. Now, multiply this by $\frac{ a^\alpha - b^\alpha} { a-b}$ which is an integer. Hence, $p^k | \frac{a^n-b^n}{a-b}$, and we are done.
A: Write down the unique prime factorization of  $n = p_1^{k_1} \cdot p_2^{k_2} \cdot \ldots \cdot p_l^{k_l}$. Then $n \mid d^n$ implies $p_1 \cdot p_2 \cdot \ldots \cdot p_l \mid d$. Since $k_i < n$ for all $i \in \{1, \ldots , l\}$, we have $n \mid p_1^{n-1} \cdot p_2^{n-1} \cdot \ldots \cdot p_l^{n-1}$ and with $p_1^{n-1} \cdot p_2^{n-1} \cdot \ldots \cdot p_l^{n-1} \mid d^{n-1}$ our desired result $n \mid d^{n-1}$.
