Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Let $f(x)$ be a cubic polynomial (not necessarily irreducible over $\mathbb{Z}[x]$). Fix a prime $p$. Are there any ways to tell when $f(n) \equiv 0 \pmod{p}$ has 3, 2, 1, or 0 solutions?

share|improve this question
    
An obvious idea that comes to mid is trying all $p$ possible values. Is $p$ assumed to be so large that this would be impractical? –  Marc van Leeuwen Mar 21 '13 at 12:55

1 Answer 1

up vote 3 down vote accepted

$\mathbb{F}_p$ is a field, so most stuff that works for reals works here too. You can look for Cardano's formula, but you end up taking roots. To see if there are repeat roots, compute $\gcd(p'(x), p(x))$ (the formal derivative is computed as for the reals, and as there any common factors between $p(x)$ and $p'(x)$ are for roots of multiplicity greater than 1). There are algorithms for factoring polynomials, symbolic mathematics packages like PARI/GP or SAGE probably include them.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.