# What is the function “mod”

Surfing this site, I have often seen many functions and expressions involving $\bmod$ and I have no clue about its meaning. What does that $\bmod$ mean?

• Please give a context as an example. At first glance I guess what you saw is like "5 $\equiv$ 3 mod 2", right? – Gary Moore Jul 4 '15 at 6:22
• Yea, 5 ≡ 3 mod 2 is a good example – AAron Jul 4 '15 at 6:24
• have you tried to write mod math in google? – Salvador Dali Jul 4 '15 at 6:28

Let $a,b$ be integers and let $m \neq 0$ be an integer. The integer $a$ is said to be congruent to $b$ modulo $m$ if there is some integer $q$ such that $a-b = qm$. Thus that $a$ is congruent to $b$ modulo $m$ means that $m$ divides $a-b$. In this case, we write $a \equiv b \mod m$.

This notation is due to K. F. Gauss. You can find it in Gauss's book Disquisition Arithmeticae.

• Whoever is downvoting, let him or her confess and give a reason. – Gary Moore Jul 4 '15 at 6:53
• Honestly, I don't know why some people are just not reasonable. – John_dydx Jul 4 '15 at 6:53
• Three reasonable answers get a downvote. The downvoter, who seems to know better, should instead post his own, superior, answer and gain reputation points. – John Bentin Jul 4 '15 at 7:22
• The integer $q$ does not need to be nonzero. – John Bentin Jul 4 '15 at 7:27
• @JohnBentin: Thank you. A gross typo. – Gary Moore Jul 4 '15 at 9:20

It depends on the context. The usual one is with an "equivalent to" sign $\equiv$: for example, $26\equiv5\;(\!\!\!\!\mod3)$, which is read "$26$ is congruent (or equivalent) to $5$ modulo $3$", and means that $26$ and $5$ differ by a multiple of $3$. Generally, $m\equiv n\;(\!\!\!\!\mod k)$ means that $m$ and $n$ differ by an integer multiple of $k$. Here it is written with parentheses, which is the traditional way that I prefer; but you will often see it without parentheses, which is easier to write in LaTex: $26\equiv5\mod3$.

It is a reimander calculation In the standard format mod(8,4) equals 0 because there is no reimander in 8/4 but for mod(8,6) equals 2 because there is a reimander. It's just the first number divided by the second and the reimander that comes from it.

Modular Arithmetic is a topic in number theory that deals with division of numbers and their remainders (but not restricted to this). I encourage you to read more about it online here.

As an example $20 \equiv0 \ (mod\ 2)$ because 20 does not leave a remainder when divided by 2. It has very interesting applications in the field of cryptography and internet security.

• Any reason for the downvote? – John_dydx Jul 4 '15 at 7:02