Find all values of $p$ such that $ax^2+bx+c \equiv 0 (\bmod p)$ have solution

64 Views Asked by At

Is there a general way to find all values of $p$ such that the congruence $ax^2+bx+c \equiv 0 (\bmod p)$ have solution, we can assume that $ax^2+bx+c =0 $ have solution.

1

There are 1 best solutions below

0
On BEST ANSWER

There is a general way. The primes that divide $a$ are special, but easy to deal with. The prime $2$ is also easy to deal with.

We now look for the odd primes $p$ such that the congruence has a solution. The congruence has a solution if and only if $4a^2x^2+4abx+4ac\equiv 0$ has a solution, or equivalently if $(2ax+b)^2\equiv b^2-4ac\pmod{p}$ has a solution.

This is the case if and only if $b^2-4ac$ is a quadratic residue of $p$. The odd primes $p$ for which this is the case can be determined by using Quadratic Reciprocity, plus the ancillary facts that $-1$ is a QR of $p$ if and only if $p$ is of the form $4k+1$, and $2$ is a QR of $p$ if and only if $p$ is of the form $8k\pm 1$.