2

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?

2 Answers2

4

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}

enter image description here

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).

egreg
  • 1,121,712
1

Use pmod n. It is known to work.