Why can't $p^p-(p-1)^{p-1}=n^2$ be a square? Let $p$ be a prime number. Show that $p^p-(p-1)^{p-1}$ can't be a square.
In other words, there is no $n\in\mathbb{N}^{+}$ such that
$$p^p-(p-1)^{p-1}=n^2.$$ 
 A: The remaining case $p \equiv 1 \pmod 4$ left by vadim123's answer can be settled by a 2004 result of Ellenberg that there are no positive solutions to $A^4 + B^2 = C^p$ for any prime $p>211$.  This was further sharpened by Bennett, Ellenberg and Ng to show that there are no positive solutions to $A^4 + B^2 = C^n$ for any $n > 3$: https://www.math.wisc.edu/~ellenber/BeElNgdraftFINAL.pdf
As is common nowadays, the above methods make use of the modularity theorem, so quite possibly this is massive overkill for this problem.
A: I have an alternative proof not relying on the Legendre symbol of the fact that only primes satisfying $p\equiv1\operatorname{mod}4$ can possibly satisfy the equation.
If $p=2$, then $2^2-1^1 = 3$ is obviously not a square.
If $p>2$, then $p$ is odd. Therefore, $(p-1)^{(p-1)} = m^2$ is a perfect square and we have that
$$p^p = n^2 + m^2$$
is the sum of two squares. But in order for this to be true we must have $p\equiv1\operatorname{mod}4$, because if we had $p\equiv-1\operatorname{mod}4$, then $p^p\equiv-1\operatorname{mod}4$. But as every square is congruent to either $0$ or $1$ modulo $4$, $n^2+m^2$ is in $\{0,1,2\}$ modulo $4$, a contradiction (argument due to @user236182).
A: Let $p=2m+1$. Then $p^p=((p-1)^m+ni)((p-1)^m-ni)$. Now, the prime factorization in the Gaussian integers is unique and no factor on the right is divisible by $p$, so the only logically possible case is $p=4k+1=x^2+y^2$ and $(p-1)^m+ni=(x+iy)^p$. Then $1\equiv (p-1)^m\equiv x^p\equiv x\mod p$, so $x=1$. However, in this case the real part on the LHS is divisible by $y$ and the real part on the RHS is congruent to $1$ modulo $y$, which is a clear contradiction.   
A: $p=2$ gives $p^p-(p-1)^{p-1}=3$, which is not a square.  All other primes are congruent to either $1$ or $3$, modulo $4$.  I can prove that no $p$ of the latter type satisfies the given equation.
Take $p^p-(p-1)^{p-1}$ modulo $p$; we get $0-(-1)^{p-1}=-1$.  Hence a solution can exist only if $-1$ is a square modulo $p$.  This happens when the Legendre symbol $(\frac{-1}{p})=1$, but for $p\equiv 3\pmod{4}$, that is not the case, by one of the parts of the Law of Quadratic Reciprocity.
