system of algebraic operations defined for remainders under division by a fixed positive integer; system of arithmetic for integers, where numbers "wrap around" upon reaching a certain value—the modulus
In mathematics, modular arithmetic is a system of arithmetic operations for integers, differing from the usual ones in that numbers "wrap around" when reaching or exceeding a certain value, called the modulus. … Wikipedia
🌐
Wikipedia
en.wikipedia.org › wiki › Modular_arithmetic
Modular arithmetic - Wikipedia
1 week ago - If a ≡ b (mod m) and a−1 exists, then a−1 ≡ b−1 (mod m) (compatibility with multiplicative inverse, and, if a = b, uniqueness modulo m). If ax ≡ b (mod m) and a is coprime to m, then the solution to this linear congruence is given by x ≡ a−1b (mod m).
🌐
UCI Mathematics
math.uci.edu › ~ndonalds › math180a › 3congruence.pdf pdf
3 Congruences and Congruence Equations
Examples 3.16. 1. We solve the congruence equation 15x = 4 (mod 133). ... Since d = 1 and d|4, there is exactly one solution. Moreover, modulo 133, we see that
🌐
UBC Math
personal.math.ubc.ca › ~PLP › book › sec-congruence.html
5.3 Congruence modulo \(n\)
Thus being congruent modulo 2 implies that they have the same parity. ... Now assume that \(a,b\) have the same parity. Then either they are both even or they are both odd. When \(a,b\) are both even, we can write \(a=2k, b=2\ell\) and so \(a-b = 2(k-\ell)\text{.}\) ... In both cases the difference \(a-b\) is divisible by 2 and so \(a \equiv b \mod 2\) as required. ... Perhaps the main reason that congruence modulo \(m\) is so important is that congruence interacts very nicely with basic arithmetic operations.
🌐
Okstate
math.okstate.edu › people › binegar › 3613 › 3613-l11.pdf pdf
LECTURE 11 Congruence and Congruence Classes
Corollary 11.8. There are exactly n distinct congruence classes modulo n; namely, [0]n, [1]n, [2]n, .
🌐
University of Houston
math.uh.edu › ~pwalker › 3336Sp21Sec4.4Slides.pdf pdf
© 2019 McGraw-Hill Education Solving Congruences Section 4.4
Example: Find an inverse of 101 modulo 4620. Solution: First use the Euclidian algorithm to show that gcd(101,4620) = 1. ... Example: What are the solutions of the congruence 3x≡4( mod 7).
🌐
Wolfram MathWorld
mathworld.wolfram.com › Congruence.html
Congruence -- from Wolfram MathWorld
June 6, 2024 - Using congruences, simple divisibility tests to check whether a given number is divisible by another number can sometimes be derived. For example, if the sum of a number's digits is divisible by 3 (9), then the original number is divisible by 3 (9).
🌐
Cornell Computer Science
cs.cornell.edu › courses › cs2800 › 2016sp › lectures › lec12-modular.html
Modular arithmetic (CS 2800, Spring 2016)
Example: If we are working mod 5, then [2]=[7]=[12]=[−3]=[−8]. All of these have a remainder of 2 when divided by 5.
Find elsewhere
🌐
Mathematics LibreTexts
math.libretexts.org › campus bookshelves › mount royal university › higher arithmetic › 3: modular arithmetic
3.1: Modulo Operation - Mathematics LibreTexts
November 22, 2024 - Two integers \(a \) and \(b\) are said to be congruent modulo \( n\), \(a \equiv b (mod \, n)\), if all of the following are true: ... The relation " \(\equiv\) " over \(\mathbb{Z}\) is reflexive. Proof: Let \(a \in \mathbb{Z} \). Then \(a-a=0(n)\), and \( 0 \in \mathbb{Z}\). Hence \(a \equiv a (mod \, n)\). Thus congruence modulo n is Reflexive.
🌐
Reddit
reddit.com › r/explainlikeimfive › eli5: how does a congruence modulo work?
r/explainlikeimfive on Reddit: ELI5: How does a congruence modulo work?
July 20, 2020 -

I think I understand the basics of the modulo function. Assuming modulo 3 when counting up you'd go 0 > 1 > 2 > 0 ...

But then I see this equation:

a ≡ b (mod n)

And have trouble understanding it. I'm pretty sure it means that a and b have a congruent relationship when a modulo function of n is applied to them. But I'm not sure if this is correct, and what a congruent relationship is.

Thanks!

Top answer
1 of 3
1
I'm pretty sure it means that a and b have a congruent relationship when a modulo function of n is applied to them Yes, that's correct. All that means is that if you take a and b and remove as many factors of n as possible from each one, you get the same thing. For example, 1 ≡ 3 (mod 2) and 9 ≡ 5 (mod 4).
2 of 3
1
So, a ≡ b (mod n) simply means that (a-b) is divisible by n. This is equivalent to saying that if you apply the modulo n function to both a and b then you get the same result. You can easily check and see that this relation has three properties: If a ≡ b (mod n) then b ≡ a (mod n), because b-a is also divisible by n. This is called symmetry. a ≡ a (mod n) for every a, because a-a is always divisible by n. This is called reflexivity. If a ≡ b (mod n) and b ≡ c (mod n) then a ≡ c (mod n), because c-a = (c-b)-(a-b) which is divisible by n. This is called transitivity. A relation that has these three properties is called a equivalence relation. Why? Because it means that if two elements are in relation to each other, then they are "equivalent" in regards to that relation. Another cool thing is that when you an equivalence relation, you can group the elements into equivalence classes - divide all the elements into sets so that two elements are in the same set if and only if they are equivalent. Now, the modulo relation has another cool property - it preserves the algebraic operations. If a ≡ b (mod n) and c ≡ d (mod n) then a+c ≡ b+d (mod n), and the same goes for multiplication. In this case, the relation is called a congruence relation. This means that if you want to calculate (a+b) (mod n) then you can calculate a (mod n) + b (mod n) and apply (mod n) to that, and you'll get the same result.
🌐
Study.com
study.com › courses › test prep courses › texes physics/mathematics 7-12 (243) study guide and test prep
Modular Arithmetic & Congruence Classes | Study.com
For example, 1, 13, 25, and 37 all have a remainder of 1 when divided by 12. They are all in the same congruence class when working with a modulus of 12. When two integers are in the same congruence class for a modulus n, we say they are equivalent ...
🌐
NYU Math
math.nyu.edu › ~hausner › congruence.pdf pdf
3 Congruence
Mail Address 251 Mercer St. New York, NY 10012, U.S.A · Phones 212.998.3162 (voice) 212.995.4121 (fax)
🌐
Carnegie Mellon University
math.cmu.edu › ~jmackey › summer › congruences.pdf pdf
21-128 Congruences Definitions of congruence
let a1, . . . , ar, c1, . . . , cr ∈Z and n1, . . . , nr ∈N, and consider the system of congruences ... Let di = gcd(ai, ni) for each 1 ≤i ≤r. If: ... Fermat’s little theorem. Let a ∈Z and let p ∈N be prime. If p ∤a then ap−1 ≡1 mod p. Proof strategy. Consider the list 1, 2, . . . , p −1. First prove that the list a, 2a, . . . , (p −1)a is the · same list (modulo p), just rearranged; it then follows that
🌐
StudySmarter
studysmarter.co.uk › congruence equations
Congruence Equations: Examples, Definition, Linear & Explained
An example of a congruence equation is x ≡ 3 (mod 5), meaning x leaves a remainder of 3 when divided by 5. Solutions to this equation are integers that satisfy the relation, such as 3, 8, and 13. ... A congruent equation is an equation that expresses the relationship between two integers ...
Top answer
1 of 4
17

Mathematically, congruence modulo $n$ is an equivalence relation. We define:

$$a\equiv b \pmod n \iff n\mid (a - b)$$

Equivalently: When working in $\pmod n$, any number $a$ is congruent $\mod n$ to an integer $b$ if there exists an integer $k$ for which $\;nk = (a - b)$.

Now, let's compare the "discrepancies" in the equivalences you note (which are, in fact, all true):


$$13 \equiv \color{blue}{\bf 1} \pmod 4 \iff 4\mid (13-1) \iff 4\mid 12\; \checkmark$$ $$13\equiv \color{blue}{\bf 5} \pmod 4 \iff 4\mid (13-5) \iff 4\mid 8 \;\checkmark$$

  • Note, indeed, that $\color{blue}{\bf 5 \equiv 1} \pmod 4$ since $4\mid(5 - 1) = 4$ $$ $$

$$9 \equiv \color{blue}{\bf 4} \pmod 5 \iff 5 \mid (9-4) \iff 5\mid 5 \;\checkmark$$ $$9 \equiv \color{blue}{\bf -1} \pmod 5 \iff 5 \mid (9 - (-1)) \iff 5\mid 10 \;\checkmark$$

  • And again, note that $\color{blue}{\bf4 \equiv -1} \pmod 5$ since $5\mid(4-(-1)) = 5$ $$ $$

It is often customary to express equivalence modulo $n$, by choosing $b$ in $\;a \equiv b \pmod n\;$ to be such that $0 \leq b \lt n$. But this choice is simply a representative of all the numbers which belong to the same equivalence class, denoted $[b]$, $\pmod n$:

E.g. If $n = 4$, then one of the following holds: $$a \equiv b \pmod 4 \iff \begin{cases} a, b \in [0] = \{4k + 0\mid k\in \mathbb Z\} = \{\cdots, -8, -4, 0, 4, 8, 12,\cdots\} \\ \\ a, b \in [1] = \{4k + 1\mid k \in \mathbb Z\} = \{\cdots, -7, -3, 1, 5, 9, 13,\cdots\} \\ \\ a ,b \in [2] = \{4k + 2\mid k \in \mathbb Z\} = \{\cdots, -6, -2, 2, 6, 10, 14,\cdots\} \\ \\ a, b \in [3] = \{4k + 3\mid k \in \mathbb Z\} = \{\cdots, -5, -1, 3, 7, 11, 15, \cdots\} \end{cases} $$

2 of 4
15

All the equations you wrote up there are correct. $13 \equiv 5 \equiv 1 \equiv 1 + 4k \pmod 4$ for any integer $k$. Computer scientists tend to say that the 'modulus operation' returns the smallest integer between $0$ and what you're modding out by. Mathematicians take a slightly higher viewpoint, saying two numbers are considered the same if their difference is divisible by what you're modding out by.

But I would expect a different notation. Mathematically, $13 \equiv 5 \equiv 1 \equiv 1 + 4k \pmod 4$. In computer science, I would expect to see $13 \bmod 4 = 1$, or even $13\%4=1$. (In particular, none of that equivalence relation / only up to equivalence stuff).

🌐
Tjyusun
tjyusun.com › mat202 › sec-congruence
4.2 Congruences and their Properties
Show that two integers \(a\) and \(b\) are congruent modulo \(n\) if and only if they have the same remainder when divided by \(n\text{.}\) ... Use Theorem 1.3.2. One real-life example is that of computing what day of the week it is, which uses congruence modulo \(7\text{.}\)
🌐
Encyclopedia of Mathematics
encyclopediaofmath.org › wiki › Congruence
Congruence - Encyclopedia of Mathematics
If the difference $ a-b $ is not divisible by $ m $, then $ a $ and $ b $ are said to be incongruent modulo $ m $, and in order to express the incongruency of $ a $ and $ b $, the symbol · $$ a \ \not\equiv \ b \ ( \mathop{\rm mod}\nolimits \ m) $$ is used. The congruence $ a \equiv b \ ( \mathop{\rm mod}\nolimits \ m) $ expresses that $ a $ and $ b $ have identical remainders when divided by $ m $.
🌐
Calcworkshop
calcworkshop.com › home › number theory › modular arithmetic
Modular Arithmetic (w/ 17 Step-by-Step Examples!)
February 1, 2021 - Another way to think of congruence modulo, is to say that integers a and b congruent modulo n if their difference is a multiple of n. For example, 7 and 4 are congruent modulo 3 because not only are they in the same equivalence class, but their ...
🌐
ScienceDirect
sciencedirect.com › topics › mathematics › congruence-modulo
Congruence Modulo - an overview | ScienceDirect Topics
September 3, 2025 - The main part of the proof of the theorem is the verification of the impossibility of certain congruences modulo l. Of course it does not follow from this that the congruence xl + yl ≡ zl (mod l) is impossible, since this congruence is equivalent to x + y ≡ z (mod l), which always has solutions in integers not divisible by l. Moreover, it can be shown that, for example, when l = 7, the equation xl + yl = zl, when considered as a congruence, has, for any modulus, solutions not divisible by 7.
🌐
Texas A&M University
people.tamu.edu › ~yvorobets › MATH433-2010B › Lect1-04web.pdf pdf
MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued).
The integers a and b are called ... gcd(c, n) = 1, then a ≡b mod n. (ii) If c > 0 and ac ≡bc mod nc, then a ≡b mod n. ... For example, [2]4 = [2]8 ∪[6]8....