# The Remainder of $\sum _{ i=1 }^{ p-1 }{ i^{ i } }$ Divided by $p$

What is the remainder of $\sum _{ i=1 }^{ p-1 }{ i^{ i } }$ divided by $p$ when $p$ is a prime number?

I first conjectured that it would be equal to $1$ modulo $p$, but numerical evidence showed that this was not true. In fact, their values seemed rather random. For $2,3,5,7,11,13,17,19,23,29,31,37$ they follow as $1,2,3,5,3,11,0,0,10,21,18,31$ respectively. This sequence did not appear on the oeis.

I was not able to come anywhere near a closed form for this equation.

Any help would be appreciated.

• Related math.stackexchange.com/questions/405944/… (see the link to MO) There is not reason to expect anything like a closed form. Most likely it behaves basically like a random sequence. – quid Jan 27 '16 at 14:59
• @quid Yes, I thought so as well. Then is there a chance we could at least approximate the remainder? – Chad Shin Jan 27 '16 at 15:49
• I do not think so. – quid Jan 27 '16 at 15:53