[Math] Quadratic equation solutions modulo prime p

number theoryprime numbersquadratic-residuesquadratics

the question is: find all primes p that satisfy the equation:

x^2-2*x-5 = 0 (mod p)  

The discriminant is 24, and I know that the equation mod p has a solution if and only if 24 is a quadratic residue mod p.
I've used Legendre symbol and found that the solutions are:
p = +-1, +-5 (mod 24) [p=1,5,19,23 mod 24], and p=2,3.
However, something doesn't seem right, because for p=1 mod 24, 25 is not a prime!

When I've used Legendre symbol, I saw that (24/p) = (2/p) * (3/p), and found all cases when both 2 and 3 are quadratic residues mod p, and all cases in which both 2 and 3 are not quadratic residues mod p.
Maybe I missed something that the law of quadratic reciprocity requires?
[I mean, I know that 2 is a quadratic residue mod p iff p = +-1 (8), and found (using the law of quadratic reciprocity) that 3 is a quadratic residue mod p iff p = +- 1 (12)].

Thanks

Best Answer

You've proved that

If $p$ is prime then that equation has a solution if and only if (something about $p$ mod $24$).

But that says nothing about composite numbers that might happen to satisfy the congruence relation. This is not a problem:

However, something doesn't seem right, because for p=1 mod 24, 25 is not a prime!

Related Question