\pmod{n} modulo in parentheses in LaTeX

Command\pmod{n}
Modemath
Packagenone, part of LaTeX
KindFunction names

\pmod{n} typesets the symbol “modulo in parentheses”. It is a function name set in upright type.

Try it

a≡b(modn)a \equiv b \pmod{n}

Open this formula in the editor The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.

Example

\documentclass{article}
\begin{document}
\( a \equiv b \pmod{n} \)
\end{document}

Open in the editor

Compiled with pdfLaTeX from TeX Live 2023.

How to use it

\pmod{n} works only in math mode. In running text, put it between $...$ or \(...\). Outside math mode LaTeX stops with Missing $ inserted. The command is part of LaTeX; you need no package.

About function names

Typing sin x in math mode prints three italic variables s, i and n. \sin prints the name upright and puts a thin space between it and its argument. For a name LaTeX does not define, declare your own with \DeclareMathOperator from amsmath.

More function names

All function names