Coefficient formula for trace of Frobenius modulo p (source code)

= Coefficient formula for trace of Frobenius modulo p
{title2=$a_p\equiv[x^{p-1}]f(x)^{(p-1)/2}\pmod p$}

For odd $p$, let $y^2=f(x)$ be a nonsingular cubic <Weierstrass equation of an elliptic curve> over $\mathbb F_p$. Its <Trace of Frobenius> is $a_p=-\sum_x\chi(f(x))$, where $\chi$ is the <Legendre symbol> extended by $\chi(0)=0$. By the <Euler criterion>, reduce this sum to $f(x)^{(p-1)/2}$. The sum of a positive power $x^j$ over $\mathbb F_p$ is zero unless $p-1$ divides $j$, when it is $-1$. Since the polynomial has degree $3(p-1)/2<2(p-1)$, only its $x^{p-1}$ coefficient contributes.