I was interested in counting (and more generally having somehow an interesting expression) the numbers of solution of cubic equations modulo a prime $p$.
So here are my thoughts. Let take a cubic polynomial $P$, $L$ its decomposition field over $\mathbf{Q}$ and $G$ its Galois group. We denote by $N_p(P)$ the number of solutions of $P(x) = 0$ modulo $p$.
$N_p(P)$ is the number of $z\in Z$ fixed by $\sigma_p$, the frobenius substitution corresponding to $p$.
To pursue the study of the action of $\sigma_p$, two cases occurs: either $G$ is isomorphic to $\mathfrak{S}_3$ either to $\mathfrak{A}_3$.
Let focus on $G = \mathfrak{S}_3$. Then the field $L$ is a cubic extension of the quadratic field $K = \mathbf{Q}(\sqrt{\Delta})$. ($\Delta$ is the discriminant of $P$).
The cases where $N_p(P)$ is 1 or 2 are not difficult and depends on the value of the Legendre of $\genfrac(){}{0}{p}{-\Delta}$. Problems arises for determining if $N_p(P) = 0$ or $3$, both cases falling under the case where $\genfrac(){}{0}{p}{-\Delta} = 1$, the prime $(p)$ is therefore splited in $K$: we decompose it in $\mathfrak{p}\bar{\mathfrak{p}}$.
Let now suppose that $L$ is a Hilbert class field of $K$.
When $\mathfrak{p}$ is a principal ideal, $N_p(P) = 3$, whereas, when
it is not principal, $N_p(P) = 0$. But the principality of this
ideal is directly related to the representability of $p$ by quadratic forms:
(p) splits completely if it can be represented by the form
$x^2+\Delta y^2$.
So one can discuss the number of solutions by looking at the representation of $p$.
But what happens when $L$ is not a Hilbert class field of $K$?