# Does $n\mid(a^n-b^n)$ imply $n\mid(a-b)$?

Given that $n,a,b \in \mathbb{N}$ and $n\mid(a^n-b^n)$ , can we prove or disprove $n\mid(a-b)$ ?

Using Fermat's little theorem, we can prove the case when n is a prime number. What about the case when n is a composite number?
I also know that $(a-b)\mid(a^n-b^n)$ .

• For composite $n$ the claim is not necessarily true. Check $n=4,a=3,b=1$ as an example. – Brian Cheung Jun 28 '16 at 10:15
• @Linear, you should approve suggested title. – ً ً Jun 28 '16 at 10:51
• @MithleshUpadhyay I don't want to repeat the sentence in the content. We can still search the question with the text in the content. – Linear Jun 28 '16 at 10:53
• @Linear, That's valid edit to right click. – ً ً Jun 28 '16 at 10:56

We can prove $$8|(p^2-q^2)$$ where $p,q$ are odd
But we can easily choose $p\not\equiv q\pmod 8$
• And hence $8\mid (p^8-q^8).$ – awllower Jun 28 '16 at 10:16
• @awllower, Yes as $$(p^2)^4-(q^2)^4$$ is divisible by $p^2-q^2$ – lab bhattacharjee Jun 28 '16 at 10:18
We have $$a^n-b^n = (a-b)\left(a^{n-1} + a^{n-2}b+a^{n-3}b^2+\dots+ab^{n-2} + b^{n-1}\right)$$ So, if $n|(a^n-b^n)$, it is not necessarily true that $n|(a-b)$.