Valuation of power sums of polynomials over finite field

Given a prime number $p$, and an irreducible polynomial $f$ of degree $2$ over $\mathbb{F}_p$. Let $n$ be a positive integer, and define: \begin{equation*} S:=\sum_{a\in \mathbb{F}_p[t], \deg{a}\leq 1} a^n. \end{equation*}

We can easily show that $S$ is nonzero only when:

1) $n$ is divisible by $p-1$;

2) if we write $n$ as $\sum_{i=0}^l c_i p^{n_i}$ with $1\le c_i \le p-1$ for all $i$, then the summation of all $c_i$'s should be at least $2(p-1)$.

I am interested in the distribution of $v_f(S)$ when $n$ varies.

By symmetry it is easy to get an upper bound of this valuation, namely, $\frac{n}{2p}$. I am wondering whether there is a formula for this valuation or any better bound.

Any some further questions:

1) What if $f$ is of higher degrees?

2) What if we substitute $p$ with some prime power?

• $q$ appears in the definition of $S$, but nowhere else; is it a typo for $p$? If not, what is it? – Gerry Myerson Jun 14 '13 at 4:12
• It should be a $p$. Corrected, thanks! – Yujia Qiu Jun 14 '13 at 14:54
• Hi Yujia, welcome to M.O.! – Filippo Alberto Edoardo Jun 14 '13 at 16:20
• Hi Filippo, it's you! Nice to see you here! – Yujia Qiu Jun 17 '13 at 9:22