a ∣ b and a ∤ b in formulas
Usually \mid
is used for the "is a divisor of" relation. It's just a vertical bar, but declared a relation symbol.
For the negation, \nmid
from amssymb
is better than \not\mid
that doesn't give a good result.
It is surely a good defining semantically sound names, for instance
\usepackage{amssymb}
\newcommand{\divides}{\mid}
\newcommand{\notdivides}{\nmid}