TITLE: What is a function field analog of Giuga's conjecture?
QUESTION [7 upvotes]: Giuga's conjecture (1950), which is still open and has strong numerical support, reads :

Let $n$ be a positive integer. If $1+\sum_{k=1}^{n-1}k^{n-1} \equiv 0\pmod{n}$ then $n$ is prime.

What would an analog for function fields be?

REPLY [11 votes]: Here is a proof of the experimental fact Joe Silverman discovered.
Let $f$ be a polynomial of degree $d$ in $R:=\mathbb{F}_q[x]$. For $I=(f)$, the sum
$$1+\sum_{a \in R/I} a^{\# R/I - 1}$$
is equal, modulo $f$, to
$$1+\sum_{g \in R,\, \deg g < d} g^{q^d-1}.$$
Let
$$F_d(x) :=  1+\sum_{g \in R,\, \deg g < d} g^{q^d-1} \in R.$$
We shall show that if $f$ is irreducible than $f \mid F_d$ and if $f$ is reducible than $f \nmid F_d$.
First, suppose that $f$ is reducible. Let $\alpha$ be a root of $f$, with minimal polynomial $m_{\alpha} \mid f$ and $\deg m_{\alpha} = e < d$. We can write any $g \in R$ of degree $<d$ uniquely as $m_{\alpha} g_0 + g_1$ where $\deg g_1 < e$ and $\deg g_0 < d-e$. Hence
$$F_d(\alpha) = 1+\sum_{g_0,g_1 \in R,\, \deg g_0 < d-e, \, \deg g_1 < e} (m_{\alpha}(\alpha) g_0(\alpha)+g_1(\alpha))^{q^d-1} = 1+q^{d-e}\sum_{g_1 \in R,\, \deg g_1 < e} g_1(\alpha)^{q^d-1}=1$$
since we are in characteristic $p \mid q$. Hence $F_d$ cannot be divisible by $f$.
Next suppose that $f$ is irreducible and let $\alpha$ be a root of $f$.
The map $g \mapsto g(\alpha)$ from $\mathbb{F}_q[x]/I$ to $\mathbb{F}_q[\alpha] = \mathbb{F}_{q^d}$ is an isomorphism, and so
$$F_d(\alpha) = 1+\sum_{\beta \in \mathbb{F}_{q^{d}}} \beta^{q^d-1}=q^d =0$$
by Lagrange's Theorem applied to the multiplicative group of the field. Hence $f$ divides $F_d$, as needed.