When a is the remainder when b is divided by n, we say b is congruent to a mod n.
How is it typeset using LaTeX?
When a is the remainder when b is divided by n, we say b is congruent to a mod n.
How is it typeset using LaTeX?
There are several ways, choose the one you prefer.
\documentclass{article}
\usepackage{amsmath}
\renewcommand{\arraystretch}{1.5} % just to make the lines spread out
\begin{document}
\begin{tabular}{lll}
\verb|$a\equiv b \pmod{n}$| & $a\equiv b \pmod{n}$ \
\verb|$a\equiv b \mod{n}$| & $a\equiv b \mod{n}$ \
\verb|$a\equiv b \pod{n}$| & $a\equiv b \pod{n}$ \
\verb|$a\equiv b \bmod{n}$| & $a\equiv b \bmod{n}$ & (wrong)
\end{tabular}
\end{document}
Don't forget the braces: try a\equiv b \pmod 11 or a\equiv b \pmod pq and see why.
The last one is marked “wrong”, because the usage is improper: \bmod should be used for the “modulo” binary operation (the one that is often denoted by % in computing).
Use pmod n. It is known to work.
b\equiv a\pmod{n}– egreg Sep 23 '21 at 16:27b\equiv a \mod{n}(no parentheses, same spacing) orb\equiv a \bmod{n}(no parentheses, smaller spacing). All this is explained in theamsmathdocumentation. – Bernard Sep 23 '21 at 18:29