Simple Modular Arithematic with Negative Numbers

40 Views Asked by At

If given an equation in the form:

3 = x mod 13

I know that I can generate a solution set by doing:

X = 13q + 3

And solving for x with incrementing values of q.

But what if 3 was a negative number instead? How would I manage to find possible solutions for x?

1

There are 1 best solutions below

2
On BEST ANSWER

I think you mean $x=3($mod $13)$, which has a solution set as you mentioned. If $3$ were a negative number you would generate a solution set the same way. Say $x=-3($mod $13)$ then $x=13q+(-3)$ or $x=13q-3$. Note that for positive integers $a,b$ with $a>b$, $b($mod $a)=-(a-b)($mod $a)$.