# Proving that $p ^ {p + 2} + (p + 2)^{p} \equiv 0\pmod{2p + 2}$ for a prime $p>2$

So, the task is to prove the following:

$$p ^ {p + 2} + (p + 2)^{p} \equiv 0 \pmod{2p + 2}$$

For all prime numbers $$p > 2$$.

I haven't got any clue on how to do this, but, for some reason, I feel like it is somehow related to the Euler's theorem or its 'friend' Fermat's little theorem.

One observation I have made is that this expression can be refactored as $$a ^ b + b ^ a \equiv 0 \pmod{a + b}$$ which is maybe another way to think about the problem.

Any help would be appreciated!

We can assume $$p$$ odd.

Since $$p^{p+2}+(p+2)^p$$ is a sum of two odd numbers, it is even. Thus, it is enough to prove that the sum is divisible by $$p+1$$. Modulo $$p+1$$, the expression is $$(-1)^{p+2}+1^p=0$$ since $$p$$ is odd. Hence the original expression can be divided by $$2p+2$$.

As $$p,p+2$$ are odd, so it's sufficient to prove $$p+1$$ divides $$p^{2m+1}+(p+2)^n$$

Now $$p\equiv-1\pmod{p+1}\implies p^{2m+1}\equiv?$$

and $$p+2\equiv1\pmod{p+1}\implies(p+2)^n\equiv?$$

Let $$p$$ be an odd prime. Note that by Fermat's Little Theorem, $$2p+2$$ divides $$p^{p} + (p+2)^{p}$$, thus it suffices to prove that $$2p+2$$ divides $$p^{p+2}-p^p$$ since $$p^{p+2}+(p+2)^p=(p^{p+2}-p^p)+p^p+(p+2)^p.$$ Notice that the task is now easy. Hint: $$p^{p+2}-p^p=p^{p}(p+1)(p-1)$$.

$$p^{p+2} +(p+2)^p \equiv p^{p+2} + (-p)^p \equiv p^{p+2}-p^p\equiv p^p(p^2 -1)$$

$$p^p(p+1)(p-1)\equiv p^p(2p + 2)\frac {p-1}2 \equiv 0\pmod {2p+2}$$

Unless I did something horribly wrong this will be true for any odd number $$p$$ whether prime or not.