# Elementary Number Theory $(a+b,\frac{a^p+b^p}{a+b})=1 \text{ or } p$

Assume $(a,b)$=1, and let $p$ be an odd prime, prove that $$(a+b,\frac{a^p+b^p}{a+b})=1 \text{ or } p$$.

I thought of letting $p=2k+1,k\in\mathbb{Z}$,

then use the identity

$$a^{2k+1}+b^{2k+1}=(a+b)(a^{2k}-a^{2k-1}b+a^{2k-2}b^2-\ldots+b^{2k})$$

So dividing throughout,

$$\frac{a^p+b^p}{a+b}=a^{2k}-a^{2k-1}b+a^{2k-2}b^2-\ldots+b^{2k}$$

However, after that, I am kind of stuck..

Sincere thanks for any help!

-
Hint: suppose that $h$ divides $a+b.$ Note that $(-a)^{k}b^{p-1-k} \equiv b^{p-1}$ (mod $h$). –  Geoff Robinson Aug 26 '12 at 15:40
For completeness, you should show that both $1$ and $p$ can happen. –  André Nicolas Aug 26 '12 at 16:49
Let me continue the hint I wrote above. We see that if $h$ divides $a +b,$ then $\frac{a^p +b^p}{a+b} \equiv pb^{p-1}$ (mod $h$). Hence, if we let $h = {\rm gcd}(a+b,\frac{a^p +b^p}{a+b}),$ we see that $h|pb^{p-1}.$ But $h$ is coprime to $b,$ since $h |(a+b)$ and ${\rm gcd}(a,b) = 1.$ Hence $h|p,$ as required.
Later edit: Although the question does not request a proof that both $1$ and $p$ can occur, I provide one, in response to the comment of Andr\'e. If $p$ divides $a+b,$ then taking $h =p$ above shows that $\frac{a^p +b^p}{a+b} \equiv pb^{p-1} \equiv 0$ (mod $p$), so that $p$ divides ${\rm gcd}(a+b,\frac{a^p +b^p}{a+b})$ in that case, and the gcd is equal to $p$ by what has been shown already.