7
$\begingroup$

I want to solve the congruence $3x^2 + 6x + 1 \equiv 0 \pmod {19}$.

I know that one way to solve this is to first solve the congruence: $t^2 \equiv 5 \pmod {19}$, because $b^2 - 4ac \equiv 24 \equiv 5 \pmod {19}$.

The problem is that I am having difficulties even solving the congruence $t^2 \equiv 5 \pmod {19}$.

Does anybody have an idea how to solve either of the two above congruences?

$\endgroup$
1
  • $\begingroup$ Welcome to Mathematica.SE. Are you sure you are posting on the right site? There is nothing in your question making it clear that it is concerned with Mathematica software. $\endgroup$
    – m_goldberg
    Commented May 14, 2017 at 11:40

2 Answers 2

6
$\begingroup$
sol = Solve[ 3 x^2 + 6 x + 1 == 0, x, Modulus -> 19]

or

Reduce[3 x^2 + 6 x + 1 == 0, x, Modulus -> 19]

Confirm:

Mod[3 x^2 + 6 x + 1, 19] /. sol
$\endgroup$
1
$\begingroup$

An alternative solution of these types of congruences is possible via completing the square (as you alluded to with variable t) and using PowerModList.

3 x (x + 2) = -1,  mod 19
3 x (x + 2) = 18,  mod 19
x (x + 2) = 6,     mod 19
(x + 1)^2 = 7,     mod 19

Now let t = x + 1 and solve Mod[t^2,19]=7 for t with PowerModList.

t -> PowerModList[7, 1/2, 19]

t -> {8, 11}

Hence, x -> {7, 10}.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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