What is the command for not modularly congruent?

Negation of symbols in LaTeX is typically achieved prepending it with \not. For example

Negating symbols

\documentclass{article}
\begin{document}
$18 \equiv 0\ (\textrm{mod}\ 9) \not\equiv 2\ (\textrm{mod}\ 9)$
\end{document}

For more elaborate, larger or lengthy symbols, you can use the cancel package. In those instances \not may not provide a sufficiently-centred negation. The centernot package also provides a centred \not for symbols with larger horizontal dimension.

The ≢ character is in Unicode as U+2262, and can be entered directly with unicode-math. The command for it is \nequiv in many packages, including unicode-math, pxfonts, txfonts, newpxmath, newtxmath, stix, stix2, mnsymbol and fdsymbol.

Other symbol-lookup techniques are described in How to look up a symbol or identify a math symbol or character?


Here is an alternative, late answer using https://ctan.org/pkg/unicode-math, hence it requires LuaLaTeX or XeLaTeX. The example uses various modulo macros of the package amsmath.

\documentclass{memoir}
\usepackage{fontspec,amsmath,unicode-math}

\begin{document}
Here's to you, Donald and Leslie; 
\begin{align*}
    18 &\equiv 0 \bmod 9, \\
    18 &\nequiv 1 \mod 9, \\
    18 &\equiv 0 \pmod 9, \\
    18 &\nequiv 1 \pod 9.
\end{align*}
\end{document}

enter image description here