Article | What Is Modular Arithmetic? Why Can 17 and 5 Be “Equal”?
SeriesThe History of Mathematical Symbols and Civilization5 / 5

Article | What Is Modular Arithmetic? Why Can 17 and 5 Be “Equal”?

Modular arithmetic is a mathematical system that allows us to understand integers through the idea of “cycles.” Why can 17, which clearly is not equal to 5, be written as 17 ≡ 5 (mod 12)? Starting with clocks and remainders, this article explores congruence, residue classes, and the mathematical ideas behind the symbol “≡”, and shows how a seemingly simple symbol can open the door to a whole new world of modern mathematics.

As we trace the development of mathematics, we encounter many symbols that look simple but have surprisingly interesting histories. And after the equals sign, you may notice another rather strange symbol:

\equiv

It looks a lot like the equals sign we are familiar with, except that it has one more horizontal line. If one equals sign is already enough to represent “equality,” why did mathematicians need to create another symbol that looks so similar?

Even more strangely, what exactly does it mean when we write:

175(mod12)17 \equiv 5 \pmod{12}

What does this statement actually mean? 17 is clearly not equal to 5!

According to the ordinary arithmetic we have learned since elementary school, writing 17=517=5 is obviously wrong. But within a particular mathematical system, 17 and 5 can indeed be regarded as occupying “the same position.”

This system is what we now call modular arithmetic.

And the truly interesting thing about modular arithmetic is not simply “why 17 can be related to 5,” but a deeper question:

Why did mathematicians create a new way of deciding in what sense two numbers can be regarded as “the same”?

Understanding Modular Arithmetic Through a Clock#

If you are encountering modular arithmetic for the first time, perhaps the best place to begin is not with a mathematics textbook, but with a clock.

The integers we normally use keep increasing along an infinitely extending number line:

10, 11, 12, 13, 14, 15,10,\ 11,\ 12,\ 13,\ 14,\ 15,\ldots

But a clock does not follow this rule. When the hands pass 12, they do not continue looking for a position labeled “13.” Instead, they return to 1, then continue through 2, 3, and 4, until eventually coming back around to 12 again.

So if we only care about positions on a clock, 13 and 1 actually land in the same place, and 14 and 2 land in the same place as well:

131(mod12)13 \equiv 1 \pmod{12} 142(mod12)14 \equiv 2 \pmod{12} 153(mod12)15 \equiv 3 \pmod{12}

The phrase “modulo 12” can first be understood in a very intuitive way:

Every time you pass 12, you go around the cycle again.

So 25 o’clock still corresponds to 1 o’clock on a clock:

251(mod12)25 \equiv 1 \pmod{12}

And 37 o’clock still corresponds to 1 o’clock:

371(mod12)37 \equiv 1 \pmod{12}

Therefore:

1, 13, 25, 37, 49,1,\ 13,\ 25,\ 37,\ 49,\ldots

Although these numbers are different from one another in the ordinary world of integers, they occupy the same position in the world of modulo 12.

This is the most basic idea behind modular arithmetic: we temporarily stop caring about how large an integer is and care only about the “position” left behind when it is divided by a particular number.

So Why Can 17 Be Put Together with 5?#

Now let’s return to the seemingly strange expression at the beginning:

175(mod12)17 \equiv 5 \pmod{12}

There is actually nothing mysterious about it.

Because:

175=1217-5=12

And 12 is exactly the modulus we have chosen. Put in a more familiar way, when 17 is divided by 12, the remainder is 5, so we can write:

175(mod12)17 \equiv 5 \pmod{12}

The same is true for 29:

295=2429-5=24

Since 24 is a multiple of 12:

295(mod12)29 \equiv 5 \pmod{12}

The same goes for 41:

415=3641-5=36

Therefore:

5, 17, 29, 41, 53,5,\ 17,\ 29,\ 41,\ 53,\ldots

Although these numbers keep getting larger, they all occupy the same position in the modulo 12 sense.

In general, we can write this relationship as:

ab(modn)a \equiv b \pmod n

Its strict definition is:

n(ab)n \mid (a-b)

In other words, the difference between aa and bb is divisible by nn.

Therefore:

175(mod12)17 \equiv 5 \pmod{12}

What this really says is not “17 equals 5,” but:

The difference between 17 and 5 is a multiple of 12, so they are congruent modulo 12.

The word “congruent” is important here because it captures the fundamental difference between “=” and “≡”.

What Is the Difference Between “=” and “≡”?#

We can perfectly well write both:

17517 \neq 5

and:

175(mod12)17 \equiv 5 \pmod{12}

These two statements are not contradictory at all. They simply describe facts at two different levels.

So “≡” is definitely not just another way of writing “=”. The question asked by “=” is:

Are the two numbers exactly the same?

Whereas “≡” asks:

Once a modulus has been specified, do these two numbers have the same remainder?

This is actually a very interesting mathematical idea. Mathematics has not changed the number 17, nor has it turned 5 into 17. It has simply changed which properties of these numbers we choose to focus on.

It is just like a clock. In the ordinary world of integers, 13 is simply 13. But if we only care about its position on a 12-position cycle, then 13 and 1 are grouped into the same position.

The mathematical objects have not changed. What has changed is the way we look at them.

Remainders Were Once Just Calculation Results. Gauss Turned Them into a Relationship#

This brings us to what was truly important about Gauss.

Of course, human beings did not have to wait until 1801 to discover remainders. Long before then, people already knew how to calculate things like “17 divided by 12 leaves a remainder of 5.”

But there is an important difference between “the remainder is 5” and “17 is congruent to 5.”

The former mainly describes the result of a calculation, while the latter defines a relationship between two integers:

175(mod12)17 \equiv 5 \pmod{12}

Once we represent this relationship with a dedicated symbol, we can begin to study its properties systematically, without having to repeatedly describe it as “the difference between the two numbers is divisible by 12.”

In 1801, Gauss (Carl Friedrich Gauss) introduced the three-bar symbol “≡” in Disquisitiones Arithmeticae to represent congruence and related identity relations. It later became one of the most important symbols in modular arithmetic, and an important milestone in the historical differentiation of the equals sign and other related mathematical relations.

So if we had to say what Gauss actually accomplished, it would be more accurate not to say that “Gauss invented remainders,” but rather:

Gauss organized previously scattered problems involving divisibility and remainders into a theory that could be studied using a unified notation.

This may look like nothing more than the addition of a symbol, but in reality it changed the kinds of problems mathematicians could work with.

More Interesting Still: Congruences Can Actually Be Computed#

If modular arithmetic merely told us that “17 and 5 have the same remainder,” it would not seem particularly remarkable. The truly interesting part is that congruence relations can be preserved under addition and multiplication.

For example, we already know:

175(mod12)17 \equiv 5 \pmod{12}

So if we add 8 to both sides, we get:

17+85+8(mod12)17+8 \equiv 5+8 \pmod{12}

That is:

2513(mod12)25 \equiv 13 \pmod{12}

And since both 25 and 13 have a remainder of 1:

25131(mod12)25 \equiv 13 \equiv 1 \pmod{12}

The same works for multiplication.

Because:

175(mod12)17 \equiv 5 \pmod{12}

we can multiply both sides by 8:

17×85×8(mod12)17\times8 \equiv 5\times8 \pmod{12}

Therefore:

13640(mod12)136 \equiv 40 \pmod{12}

And since both 136 and 40 leave a remainder of 4 when divided by 12:

136404(mod12)136 \equiv 40 \equiv 4 \pmod{12}

The significance of this is that we do not always have to carry the original large numbers through our calculations.

For example, suppose we want to know:

1000007(mod12)1000007 \pmod{12}

This number looks very large, but in the world of modulo 12, it is actually quite “lightweight,” because:

100000711(mod12)1000007 \equiv 11 \pmod{12}

So in subsequent calculations modulo 12, we can temporarily treat 10000071000007 as 11. A very large integer has thus been compressed into a very small state.

This is no longer merely a “trick” for finding remainders. It is beginning to reveal a very powerful mathematical structure.

Infinitely Many Integers Can Be Compressed into a Finite Number of Positions#

Suppose we are working modulo 12. There are infinitely many integers:

,2,1,0,1,2,,10,11,12,13,14,\ldots,-2,-1,0,1,2,\ldots,10,11,12,13,14,\ldots

But if we only care about the remainders they leave when divided by 12, then all integers will eventually fall into just 12 categories:

0, 1, 2,,110,\ 1,\ 2,\ldots,11

For example:

5, 17, 29, 41,5,\ 17,\ 29,\ 41,\ldots

all belong to the category whose remainder is 5. And:

8, 20, 32, 44,8,\ 20,\ 32,\ 44,\ldots

all belong to the category whose remainder is 8.

Thus, infinitely many integers are divided into a finite number of categories.

This is one of the most important things to understand about modular arithmetic: it does not simply make numbers smaller. It reorganizes the relationships between numbers.

If we imagine the infinitely extending number line as a road, modular arithmetic modulo 12 is like joining the two ends of that road together and turning it into a circle.

On this road, starting from 0 and moving forward 12 steps brings us back to the original position; taking another 12 steps brings us back there again.

Therefore:

0122436(mod12)0 \equiv 12 \equiv 24 \equiv 36 \pmod{12}

and:

1132537(mod12)1 \equiv 13 \equiv 25 \equiv 37 \pmod{12}

This is why a clock makes such an intuitive model for modular arithmetic: a clock is itself a very natural modulo 12 system.

From “Numbers” to “Positions”: What Is a Residue Class?#

At this point, we can take one more step forward.

If:

5172941(mod12)5 \equiv 17 \equiv 29 \equiv 41 \pmod{12}

then we no longer need to treat these numbers separately. We can regard them as a whole.

This whole is called a residue class.

For example, all integers that are congruent to 5 modulo 12 can be written as:

[5]={,19,7,5,17,29,41,}[5]=\{\ldots,-19,-7,5,17,29,41,\ldots\}

Although all the integers in this set are different from one another, they occupy exactly the same position in the sense of modulo 12.

At this point, the object we are studying has changed once again.

At first, we were interested in:

How much is 17?

Then, we became interested in:

What is the remainder when 17 is divided by 12?

Later, we began to ask:

Which congruence class does 17 belong to?

And from the perspective of modern mathematics, we can go even further and ask:

What kind of algebraic structure do these congruence classes have?

This step is important because mathematics begins to shift its attention from specific numbers to the relationships between objects and the structures formed by those relationships.

Following this path gradually leads us into the world of modern abstract algebra.

Why Does Modular Arithmetic Deserve to Be a Complete Mathematical System?#

If we only use modular arithmetic to tell the time on a clock, it is certainly convenient, but it may not seem necessary to elevate it into a mathematical theory.

What makes it truly important is that it provides a very general mathematical method:

Transforming a problem that is originally infinite and complex into a finite structure that can still be operated on.

For example, if we only care about the remainder of an integer after division by 3, then no matter how large the integer is, it can ultimately occupy only three possible states:

0, 1, 20,\ 1,\ 2

If we work modulo 10, we only need to consider:

0,1,2,,90,1,2,\ldots,9

And if we work modulo 2, the entire world is reduced to just two states:

0, 10,\ 1

From this perspective, what modular arithmetic really does is not simply “make large numbers smaller.” It projects the infinite world of integers onto a finite structure while preserving, as much as possible, the operations and relationships that we actually care about.

This is also an important reason why it later became useful in number theory and many areas of modern mathematics and computing.

In modern computer science, the mod operation essentially asks which position a number occupies after being divided by another number. The same idea can be found in cyclic structures, hashing, cryptography, coding, and other fields. Of course, these modern applications were not what Gauss had in mind when he developed the theory of congruences in 1801. They emerged naturally from this structure as mathematics and computing continued to develop.

A Very Small Symbol Opens the Door to a New Mathematical World#

Now let’s return to the equation that seemed so puzzling at the beginning:

175(mod12)17 \equiv 5 \pmod{12}

It can actually be understood on three different levels.

The first level is the ordinary world of integers:

17517 \neq 5

17 and 5 are two different integers. There is nothing problematic about that.

The second level is the world of modulo 12:

175(mod12)17 \equiv 5 \pmod{12}

Because they differ by a multiple of 12, they belong to the same congruence class.

The third level is to abstract this relationship further into a residue class:

[17]=[5][17]=[5]

At this point, we are no longer focusing our attention on two particular integers. We are studying an entire set consisting of infinitely many integers.

In other words, starting with “17” and “5,” what we ultimately study is no longer two particular numbers, but:

The relationships between these numbers, and the mathematical structures that these relationships can form.

This is an important direction in the increasing abstraction of modern mathematics, and it also explains why the symbol “≡” fits so naturally after the story of the equals sign.

The equals sign answers the question:

When can two things be considered equal?

Congruence goes one step further and asks a more daring question:

If we change the standard by which we decide whether things are “the same,” what kind of mathematical world will emerge?

The answer is: a completely new mathematical structure.

From “=” to Congruence, and Then to Modern Mathematics#

In 1557, Robert Recorde used the familiar “=” to represent equality in The Whetstone of Witte. The symbol gradually spread and eventually became the standard symbol for expressing equality in modern mathematics.

Several centuries later, as mathematicians faced increasingly complex problems, they continued to create specialized symbols for different relationships.

In 1801, Gauss used “≡” in Disquisitiones Arithmeticae to represent congruence relations. Mathematics later developed specialized symbols for other relationships, such as “not equal to” and “approximately equal to.”

If we look only at the symbols themselves, it may seem that mathematics was simply accumulating more and more notation.

But from the perspective of the development of mathematical ideas, something much more important was happening:

Human beings were becoming capable of expressing and manipulating increasingly complex ideas.

And the set notation, logical symbols, and language of abstract algebra that appeared later allowed mathematics to study structures, relationships, and even mathematics itself directly.

So, what makes a mathematical symbol truly important is often not that it saves a few characters in an equation, but that:

It gives human beings a way of thinking that was once difficult, or even impossible, to express.

Modular arithmetic is a particularly beautiful example.

It begins with an extremely simple question: Why do two numbers sometimes leave the same remainder when divided by the same number?

But if we continue asking questions about this simple observation, what we eventually obtain is not merely a more convenient way to perform division, but a new mathematical perspective:

We can reorganize infinitely many integers according to certain relationships, allowing them to form a finite, cyclic world in which operations are still possible.

And the gateway to this world is a symbol that looks very much like the equals sign, but is not the equals sign:

\equiv

So, the next time you see:

175(mod12)17 \equiv 5 \pmod{12}

don’t simply read it as “17 equals 5.”

A more accurate way to understand it is:

17 and 5 occupy the same position in the world of modulo 12.

And if you continue forward from this seemingly simple idea, you will encounter residue classes, groups, rings, and fields, eventually entering the world of modern abstract algebra.

This is also one of the fascinating things about the history of mathematics:

A symbol that seems to have been created simply to make calculation more convenient can ultimately open up an entirely new way of seeing the world.

License

You may quote content from this site with proper attribution and a link to the original source. Republishing full articles or using the content for commercial purposes without prior permission is not permitted.

Related Posts