Today somebody has asked the following:
Can the number $S_{n,k}=\sum_{j=1}^n j^k$ be prime for positive integers $n,k$?
I don't know the reason, but the question was deleted few minutes after. I don't remember her/his username.
I find the question interesting enough to ask it again. I have some results as well.
The case $n=1$ is trivial.
The case $n=2$ gives some examples, namely Fermat primes. So we assume from now that $n\ge 3$. (The original problem put this as a condition).
If $n$ is a power of two, the sum has $n/2$ odd numbers, and $n/2$ is even, so the sum is even, and, obviously, greater than $2$, so $S_{2^r\!,k}$ is composite.
If $n$ has an odd prime divisor $p$ and $k$ is not a multiple of $p-1$, the numbers $$1^k, 2^k,\ldots,(p-1)^k$$ are exactly the roots of the polynomial $$X^{(p-1)/d}-1\in\Bbb Z_p[X]$$ where $d=\gcd(p-1,k)$, counted $d$ times each, so their sum is $0$. Since $n$ is a multiple of $p$, this sum is repeated $n/p$ times, so it is $0$ $\pmod p$ also. In other words:
If $p$ is an odd prime divisor of $n$ and $k$ is not a multiple of $p-1$, then $p\mid S_{n,k}$
What happens if $n$ has no such divisor? Well, I have also obtained a few facts.
- If $n\equiv 3\pmod 4$, then the sum contains $(n+1)/2$ odd terms, so it is even.
- If $n$ is a prime $p$, $2p+1$ is also prime and $k=p-1$, the numbers $$1^{p-1},2^{p-1},\ldots,p^{p-1}$$ are the roots of the polynomial $$X^p-1\in\Bbb Z_{2p+1}[X]$$ so again, their sum is $0\pmod {2p+1}$. That is:
If $p$ is prime and $2p+1$ is prime, then $2p+1\mid S_{p,p-1}$
Of course, there are many not covered cases.
Yep! I was about to post my answer to the question but it was deleted at that time!! I have concluded the following
It is not very difficult to show that (when $k$ is odd) $$1+2+\cdots+n\mid1^k+2^k+\cdots n^k$$Also $k=1$ case is trivial as the sum is just $\frac{n(n+1)}{2}$. Thus, for $k>1$, $$1\ne 1+2+\cdots+n<1^k+2^k+\cdots+n^k$$and hence, the sum cannot be a prime number when $k$ is odd as it will have a divisor $1+2+\cdots+n$.