Let \(Q=a^2+ab+b^2\). If \(3\mid n\), then \(a^3-b^3=(a-b)Q\), so \(a^3\equiv b^3\pmod Q\), and therefore \(Q\mid a^n-b^n\). In this case the gcd is \(Q\). Now suppose \(3\nmid n\). Let a prime \(p\ne3\) divide both \(Q\) and \(a^n-b^n\). Since \(p\nmid b\), put \(t\equiv ab^{-1}\pmod p\). From \(Q\equiv0\), we get \(t^2+t+1\equiv0\), hence \(t^3\equiv1\) and \(t\not\equiv1\). Thus the order of \(t\) is \(3\). But \(a^n\equiv b^n\) gives \(t^n\equiv1\), so \(3\mid n\), a contradiction. Therefore, when \(3\nmid n\), the only possible common prime divisor is \(3\). The number \(3\) divides \(Q\) exactly when \(a\equiv b\pmod3\); by coprimality neither is divisible by \(3\), and then \(Q\) is divisible by \(3\) but not by \(9\). Under the same condition \(a^n-b^n\) is divisible by \(3\). Answer: if \(3\mid n\), the gcd is \(Q\); if \(3\nmid n\) and \(a\equiv b\pmod3\), the gcd is \(3\); otherwise the gcd is \(1\).