# Why does 3x ≡ -29 (mod 5) equal to 3x ≡ 1 (mod 5)

I'm having some trouble understanding the following problem, why can you write the following congruence:

$$3x ≡ -29 \pmod{5}$$ as

$$3x ≡ 1\pmod{5}$$

• Because $-29\equiv 1 \pmod 5$. – lulu Jun 19 at 13:50
• $3x+5 \equiv -24 \ldots \implies 3x+15 \equiv -14\,\ldots \implies 3x+30 \equiv 1\, \implies 3x \equiv 1\, \quad (\text{Mod}\, 5)$ – Kevin Jun 19 at 13:54
• in short just add 30 on both side and know that $30=0 (mod 5)$ – JustWandering Jun 19 at 13:57
• Why is this question downvoted? It's a perfectly legitimate one? – David Jun 19 at 14:10
• @David Agreed, I upvoted. – Kevin Jun 21 at 13:54

We have that $$1-(-29)=30$$ so $$5$$ divides to $$1-(-29)$$. That means that $$-29 \equiv 1 \ (\mbox {mod }5)$$. By transitivity we have that if $$3x \equiv -29 \ (\mbox {mod }5)$$ and $$-29 \equiv 1 \ (\mbox {mod }5)$$ then $$3x \equiv 1 \ (\mbox {mod }5).$$

• Thanks for the answer, but how did you get to −29≡1 (mod 5) thats the part i dont really understand – kokayy Jun 19 at 14:20
• @kokayy $-29 \equiv 1 (mod 5)$ because $-29 = (-6)*5 +1$ and $1 = (0)*5 +1$ Similarly, 11, 16, -4, -9... are also congruent with 6 – David Jun 19 at 14:22
• @David ohh makes perfect sense now! thanks alot – kokayy Jun 19 at 14:23
• @kokayy If $m \in \mathbb{N}$ and $a,b \in \mathbb{Z}$ then $a \equiv b \ \mbox{(mod }m)$ if and only if $m$ divides to $b-a$. – Mainkit Jun 19 at 15:56

Keep in mind that, in $$\mathbb{Z}/5\mathbb{Z}$$, 5 and 0 are the same $$5 \equiv 0 (\mod 5)$$

Since 5 and 0 are the same, you can add $$0$$ to the left -hand side of the equation and $$5$$ to the right-hand side, because you are actually adding $$0$$ on both sides.

This reasoning works for every multiple of $$5$$, $$30$$ included. Similarly, you could add $$6$$ to one side of the equation and $$13$$ to the other, without altering the solutions.

Also, since $$\mathbb{Z}/5\mathbb{Z}$$ happens to be a field ($$5$$ is prime), you can do the same thing for multiplication except, of course, you are not allowed to multiply by $$5$$ (because it's $$0$$!), so it's the same rules as with equations in $$\mathbb{R}$$

If you were in $$\mathbb{Z}/n\mathbb{Z}$$, with n not prime, you would be able to multiply both sides of the equation by $$m$$ (without creating any new false solutions) as long as $$\gcd(n,m)=1$$

Alternative look.

In e.g. the theory of abelian groups

$$3x\equiv -29\mod5$$ expresses exactly that: $$\{3x+5n\mid n\in\mathbb Z\}=\{-29+5n\mid n\in\mathbb Z\}$$

(This especially when we are dealing with group $$\mathbb Z/5\mathbb Z$$)

Note that here the equivalence sign is replaced by the equality sign, which might make things more simple to grasp.

Now observe that it is not difficult to prove that $$\{-29+5n\mid n\in\mathbb Z\}=\{1+5n\mid n\in\mathbb Z\}$$ so that the equality can also be written as:$$\{3x+5n\mid n\in\mathbb Z\}=\{1+5n\mid n\in\mathbb Z\}$$or again as:$$3x\equiv 1\mod5$$

• Be aware that congruence is not normally defined to be "actually a notation" for an equality of (co)sets. Rather, the usual definition is that $\,a\equiv b\pmod{\! n}\iff n\mid a-b.\$ Usually the coset viewpoint is not considered at length until quotient rings are introduced (often much later - perhaps even in a different book/course). – Bill Dubuque Jun 19 at 14:45
• @BillDubuque Yes, you are right. I have decided to delete this answer within some minutes. – drhab Jun 19 at 14:48
• You could instead just mention it as another viewpoint instead of "actually a notation" and that would help to avoid any confusion. No doubt that it is a useful viewpoint. – Bill Dubuque Jun 19 at 14:49
• @BillDubuque So I did then. Thank you for your comment. – drhab Jun 19 at 14:56