<s>[INST] Solve $1^n+2^n+ \ldots +n^n=k!$ over positive integers If $k,n \in \mathbb{N}^*$, solve the following equation
$1^n+2^n+ \ldots +n^n=k!$, where $k! $ denotes $1 \cdot 2 \cdot 3 \cdots k$.
 [/INST] I will answer for $n$ odd, because barto above answered the question for $n$ even.
We have $1^n+2^n+ \ldots+n^n=1+(2^n+n^n)+(3^n+(n-1)^n) + \ldots \equiv 1 \pmod {n+2}$.
So, $k! \equiv 1 \pmod {n+2}$. If $k \geqslant n+2$, we have $k! \equiv 0 \pmod {n+2}$.
So, $n<k<n+2$, which yields $k=n+1$.
We have now $(n+1)! \equiv 1 \pmod {n+2}$.
If $n+2$ is a prime, let $n+2=p$ we have $(p-1)! \equiv 1 \pmod p$ and by Wilson $(p-1)! \equiv -1 \pmod p$, so there are no solutions.
If now $n+2$ is not a prime, let $n+2=ab, (a,b)=1, a,b \leqslant n+1$ we have that $a,b \mid (n+1)! \Rightarrow ab \mid (n+1)! \Rightarrow n+2 \mid (n+1)!$, which is a contradiction.
So, we do not have solutions if $n \geqslant 3$ odd .
</s>