amodn is the remainder when a is divided by n, a whole number from 0 to n−1. It makes indices wrap around: position tmodT in a cyclic buffer, the even and odd dimensions (imod2) of a positional encoding, a hash into n buckets.
Written as a≡b(modn) it is a statement, not an operation: a and b leave the same remainder (see Identically equal).
How to type it
LaTeX
Shows
a \bmod nas an operation
amodn
a \equiv b \pmod{n}as a congruence
a≡b(modn)
a \mod nwith wider spacing
amodn
A worked example
7mod3=1,12mod4=0,17≡2(mod5)
17=3×5+2, so 17 leaves remainder 2.
Common confusions
For negative a, programming languages disagree: Python gives −1mod3=2, C gives −1.