Solution. Let d=gcd(a,b), p=a/d and q=b/d. Since pn-qn divides an-bn, (pn-qn) divides (an-bn) and it is sufficient to prove n|(pn-qn). Therefore, it can be assumed that a and b are co-prime.
Note that a and b are relatively prime with an-bn as well.
Consider the multiplicative group of the reduced residue system modulo an-bn. Let c=ab-1. Since
the order of element c is exactly n.
By Lagrange's theorem, the order of element c divides the order of the group, therefore n divides (an-bn).