You write 7 \equiv -3 \pmod{10}, and something in your head rebels. Seven is a positive number. Negative three is a negative number. They sit on opposite sides of zero on the number line. How can they be congruent — aren't congruent things supposed to be, in some sense, the same?

The short answer: yes, they really are congruent, and yes, they really are "the same" in the only sense that mod 10 cares about. The apparent paradox comes from secretly expecting \equiv to care about the sign of a number, when what it actually cares about is the remainder class. Negatives and positives share remainder classes all the time.

The rule, re-stated

a \equiv b \pmod{n} means n divides a - b. Apply this to a = 7, b = -3, n = 10:

7 - (-3) = 7 + 3 = 10.

Is 10 divisible by 10? Obviously yes. So 7 \equiv -3 \pmod{10} is true by the definition. Nothing about the definition says a and b have to have the same sign. The definition only asks whether their difference is a multiple of n.

Why this is the natural definition: congruence modulo n is meant to capture "same remainder when divided by n." And -3, when divided by 10, has remainder 7 (more on that in a second). So 7 and -3 really do share a remainder; they sit in the same residue class. The minus sign is a feature of how you are writing the number, not a feature of which class it belongs to.

What does -3 \div 10 actually mean?

The usual division algorithm says: for any integer a and positive integer n, there is a unique pair (q, r) with a = qn + r and 0 \le r < n. That rule applies to negative a too — you just have to let q be negative.

For a = -3, n = 10:

-3 = (-1) \cdot 10 + 7.

So q = -1, r = 7. The remainder is 7, not -3 — because the remainder is required to lie in \{0, 1, 2, \dots, 9\}.

This matches what common sense says: if you shift left from 0 by 3, you land on -3, which is the same clock position as 7 on a mod-10 dial. You can get to -3 either by walking left 3 from 0, or by walking right 7 from 0 then subtracting 10 (one full turn). Either way, the spot on the clock is the same.

The residue class has infinitely many members

The number 7 does not sit alone in its residue class mod 10. Its class contains every integer of the form 7 + 10k for k \in \mathbb{Z}:

\{\dots, -23, -13, -3, 7, 17, 27, 37, \dots\}

Negative members are just as legitimate as positive ones. The class is an infinite set extending in both directions, with each member separated from its neighbours by exactly 10.

The residue class 7 mod 10 on the number lineA number line stretching from negative 25 to 40. Integer ticks are shown, with the members of the residue class seven mod ten highlighted at the positions minus twenty three, minus thirteen, minus three, seven, seventeen, twenty seven, and thirty seven. Arrows labelled plus ten connect consecutive highlighted points, showing the common spacing. 0 −23 −13 −3 7 17 27 +10 +10 +10 the residue class 7 mod 10 = { …, −23, −13, −3, 7, 17, 27, … } negatives and positives live together in the same class
The residue class of $7$ modulo $10$, drawn as highlighted points on the number line. Consecutive members are exactly $10$ apart. Negative members like $-3, -13, -23$ are as much a part of the class as positive members like $7, 17, 27$ — the class extends infinitely in both directions.

The clock picture

A mod-10 clock has ten positions: 0, 1, 2, \dots, 9. Start your finger at 0. Move 7 steps clockwise: you land at position 7. Now start again at 0 and move 3 steps counter-clockwise: you land at the same position. Counter-clockwise 3 is the same as clockwise 7 because the clock has 10 positions, and 10 - 3 = 7.

In words: "-3 steps" and "+7 steps" are two different names for the same position on the mod-10 dial. The minus sign is telling you which direction you came from, not which position you arrived at. Positions don't have signs; movements do.

This is the same reason a clock saying "-3 hours from now" points to the same place as "21 hours from now" on a 24-hour clock, or "9 hours from now" on a 12-hour clock. The signed count of hours is not the same thing as the clock position.

Converting any negative to its positive representative

Given a negative number a and modulus n > 0, its canonical positive representative (the remainder in \{0, 1, \dots, n-1\}) is computed by adding n repeatedly until you land in the range:

A shortcut formula: if a is negative, the remainder is a - n \lfloor a/n \rfloor, where \lfloor \cdot \rfloor is the floor function (which rounds down — toward -\infty, not toward 0). Programming language note: some languages (C, Java) give you a negative remainder for negative inputs; Python gives you the mathematical positive remainder directly. Know which one your tool uses.

Why you actually want negatives in modular arithmetic

Allowing negatives is not just tolerable — it is genuinely useful, for three reasons.

1. Subtraction is unavoidable. If a \equiv b \pmod n and c \equiv d \pmod n, then a - c \equiv b - d \pmod n. You cannot do subtraction modulo n without at least temporarily producing negative intermediates. Forcing everything to stay non-negative would break the arithmetic.

2. Small negatives are shorter than large positives. Writing -1 is often cleaner than writing n - 1. For mod 10, 9 \equiv -1 \pmod{10}, and in problems like "find the last digit of 9^{100}" the calculation (-1)^{100} = 1 is much faster than computing 9^{100} directly. You replaced 9 with -1 because they sit in the same residue class.

3. It makes modular inverses cleaner. In \mathbb{Z}/13\mathbb{Z}, the inverse of 2 is 7 (since 2 \cdot 7 = 14 \equiv 1). But using negatives, you can also write it as -6, since 2 \cdot (-6) = -12 \equiv 1. Small-magnitude representatives — positive or negative — are often the most convenient for hand calculation.

Evaluate $9^{50} \pmod{10}$

Step 1 (use negatives). Replace 9 by -1: 9 \equiv -1 \pmod{10}.

Step 2 (exponent). (-1)^{50} = 1, because 50 is even.

Step 3 (conclusion). 9^{50} \equiv 1 \pmod{10}. So the last digit of 9^{50} is 1.

Why this is so much nicer than the "positive-only" route: without the -1 substitution, you would have to reason about the cycle of last digits of 9, 9^2, 9^3, \dots which is 9, 1, 9, 1, \dots — a length-2 cycle — and then figure out which position 50 lands on. Same answer, more work. The -1 trick gives you the cycle for free.

Where negative residues show up in cryptography

In RSA and other cryptographic schemes, you constantly encounter expressions like -e \pmod{\phi(n)} — a negative exponent interpreted modulo the order of the group. The computation is: find a positive representative in \{0, 1, \dots, \phi(n) - 1\} and use that. The negative form is often how the theory is stated; the positive form is what the computer stores.

Whenever you see a formula like x^{-1} \bmod n (the modular inverse), you are reading an expression that conceptually involves a negative power, and its value is one of the residue classes — not "a fraction" or "a negative number" in the usual sense.

The takeaway

The lesson: when working mod n, train yourself to see a number and its "negative representative" as the same thing. -3 and 7 aren't two numbers that happen to be congruent mod 10 — they are two names for the same element of \mathbb{Z}/10\mathbb{Z}.

Related: Modular Arithmetic · What Does a ≡ b (mod n) Actually Mean · mod Operator vs Congruence Relation · Number Line Wrapping into a Circle · Number Theory Basics