The cube roots of minus one modulo an odd prime are controlled by
For , the quadratic factor has roots exactly when its discriminant is a square, namely when . In that case there are three distinct roots; when , only remains. For ,
so is again the unique root. Therefore