Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a difference between $i$ mod $p$, and $i$ (mod $p$)?

To give context, this is the original problem:

  • if $i \geq 0$ what is $i$ (mod $p$)?

edit: Forgot to add the parentheses to example

share|cite|improve this question
up vote 7 down vote accepted

The "mod" symbol is used two ways. In one way it modifies the assertion that two quantities are equivalent:

$$23\equiv1903\pmod {10}$$

This means that 23 and 1903 are equivalent, mod 10. In general we say that $a\equiv b\pmod p$ if $a-b$ is a multiple of $p$.

Used the other way, it is used as a binary operator to represent the remainder after a division:

$$\text{"The value of }1903\bmod 10 \text{ is } 3\text{"}$$

And in general, if $a = pk+b$, with $0\le b < p$, then $a\bmod p$ is equal to $b$, the remainder when $a$ is divided by $p$. It should usually be a number at least 0 and strictly less than $p$.

The two notations are closely related: if $a\bmod p = b$, then $a\equiv b\pmod p$.

$\TeX$ and MathJax have separate notations for the two uses, because they are typeset a little differently. \bmod makes the "binary operator" version of "mod", and \pmod makes the "parentheses" version used for qualifying equivalences.

share|cite|improve this answer
Analogous notations are used for any equivalence relation, e.g. for fractions we might write $\rm\: 15/10 \equiv 3/2\pmod{\!Q},\:$ and $\rm\:15/10\bmod Q = 3/2\ \ $ – Bill Dubuque Oct 12 '12 at 21:26
so is i mod p = i (mod p)? – James Oct 13 '12 at 22:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.