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$.
 A: Partial answer, complete for $n$ even.
Suppose $n\geq2$. Clearly, $k>n$.
Then $k!$ is even, so there is an even number of odd numbers on the left. So $n\equiv0,3\pmod4$.
Suppose $n\geq4$ is even. Odd squares are $1$ mod $8$, and $8\mid k!$, so $n/2$ is divisible by $8$. Odd $16$th powers are $1$ mod $32$ and $32\mid k!$, so $n/2$ is divisible by $32$. [...] Odd $4^m$th powers are $1$ mod $2^{2m+1}$ (Euler) so $2^{2m+1}\mid n/2$... etc, contradiction. (Boring details left out.)
Suppose $n\geq3$ is odd. Odd numbers have odd powers that are congruent to themselves mod $8$ and $8\mid k!$, so $8$ divides $1+3+\cdots+n=(n+1)^2/4$, so $n\equiv-1\pmod{8}$. Then odd numbers have $n$th powers that are congruent to their inverse modulo $32$ and $32\mid k!$, so $32$ divides $(n+1)^2/4$, so $n\equiv-1\pmod{16}$. From now this argument does not give anything new: $64\mid(n+1)^2/4$ only implies $n\equiv-1\pmod{16}$.
A: 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 .
A: This is a supplement to the answer by knm to show that $k\ge n+2$ (for large enough $n$).
Let $S_n=1^n+\cdots+n^n$. First, we show that $S_{n+1}/S_n>2(n+1)$. To do that, it suffices to show that $(r+1)^{r+1}/r^r>2(n+1)$ for all $r=0,\ldots,n$. Since the LHS is an increasing function, it has it's maximum at $r=n$, so we actually get
$$
\frac{(r+1)^{r+1}}{r^r} \ge \frac{(n+1)^{n+1}}{n^n}
> (n+1)\cdot\left(1+\frac{1}{n}\right)^n \ge 2(n+1).
$$
From this follows that
$$
\frac{S_{n+1}}{S_n} = \frac{\sum_{r=0}^n (r+1)^{r+1}}{\sum_{r=0}^n r^{r}}
> (n+1)\cdot\left(1+\frac{1}{n}\right)^n \ge 2(n+1).
$$
If $S_n>(n+1)!$ for some $n$, then if $S_n=k!$ we must have $k\ge n+2$.
However, if $S_n>(n+1)!$, then $S_{n+1}>2(n+1)S_n>(n+2)!$, so once we find one $n$ with $S_n>(n+1)!$, this is also the case for all larger $n$.
In particular, $S_3=36>4!$, so for all $n\ge3$ we have $S_n>(n+1)!$, which implies that $k\ge n+2$ if $k!=S_n$.
