What is correct set notation for "all integers which are not multiples of $7$"? My best guess is:

$$ \{ x : (\forall k \in \mathbb{Z})(\neg(7k = x)) \}$$


$$ \{ x : \neg(\exists k \in \mathbb{Z})(7k = x) \}$$

However this seems unlike other examples I have seen.

Is there are proper way to denote this set in set notation?

  • 10
    $\begingroup$ Curly brackets \{ and \} (in math mode). Your ways are fine. Words are better. $\endgroup$ Mar 2, 2016 at 5:14
  • 2
    $\begingroup$ They're both correct. In general: $$\neg (\forall x \in X) P(x) \iff (\exists x\in X) \neg P(x)$$ $\endgroup$ Mar 2, 2016 at 5:23
  • 1
    $\begingroup$ What's wrong with (x mod 7 is different than 0)? $\endgroup$
    – Dominique
    Mar 2, 2016 at 13:34
  • 33
    $\begingroup$ Don't forget about the simplest one: $\{ x : \text{x is not a multiple of 7} \}$. $\endgroup$
    – Javier
    Mar 2, 2016 at 14:03
  • 5
    $\begingroup$ Perhaps worth noting (somewhat pedantically) is that when you say "all numbers" you do mean, apparently, all integers. Although the language of "not multiples" would not lead the reader to suspect you were quantifying over $\mathbb{R}$ or $\mathbb{C}$, it is possible to believe (as I initially did) that you were quantifying over $\mathbb{N}$. $\endgroup$ Mar 2, 2016 at 19:31

9 Answers 9


I'd generally go with $\{x\in\mathbb{Z}: 7 \nmid x\}$, though this does presuppose familiarity with the $\mid \, \nmid$ notation.

  • 6
    $\begingroup$ In fact, every notation requires familiarity to use it. $\endgroup$ Mar 6, 2016 at 14:56

For starters, you should be using curly braces $\{\}$ for sets, and what you have is fine, but generally the clean abbreviation would be: $$ \mathbb{Z}-7\mathbb{Z}$$

This is because $-$ denotes set difference and $7\mathbb{Z}$ denotes the set of integer multiples of $7$.

  • 109
    $\begingroup$ Or $\mathbb{Z} \setminus 7\mathbb{Z}$ $\endgroup$ Mar 2, 2016 at 5:16
  • 12
    $\begingroup$ Note that for sets $A$ and $B$ sometimes the notation $A-B$ may be used in another sense, namely for the set of all differences $a-b$ where $a\in A$ and $b\in B$ (clearly this requires that $A$ and $B$ come from a context where there is some additive (abelian) group structure). $\endgroup$ Mar 2, 2016 at 9:41
  • 26
    $\begingroup$ In this case I'd prefer $\Bbb Z - 7\Bbb Z$ over $\Bbb Z \setminus 7\Bbb Z$, since the latter might be confused with $\Bbb Z / 7\Bbb Z$, which is a completely different set. $\endgroup$
    – Daniel R
    Mar 2, 2016 at 10:28
  • 16
    $\begingroup$ If you are worried about confusion with quotient, there’s $\mathbb Z\smallsetminus7\mathbb Z$ (\smallsetminus). I’d never use $-$ to denote set difference in the same context where I am using other arithmetic operations to act pointwise on the set, such as in $7\mathbb Z$, per Jeppe Stig Nielsen’s comment. $\endgroup$ Mar 3, 2016 at 13:32
  • 3
    $\begingroup$ @ChristianBlatter plenty of people use $-$ in both colloquial and professional environments. I don't see why this is "basically wrong". $\endgroup$
    – ASKASK
    Mar 3, 2016 at 20:51

My preferred notation is the "not divides" symbol $a \nmid b$ what means "a not divides b". But you can achieve the same meaning by different ways, by example:

$$\{n\in\Bbb Z: (\nexists k\in\Bbb Z :n/k=7)\}$$


$$\{n\in\Bbb Z:n\not\equiv 0\pmod 7\}$$

But the common notation is

$$\{n\in\Bbb Z:7\nmid n\}$$

  • 6
    $\begingroup$ $n/7 \notin \mathbb{Z}$ seems a bit more concise than the first version. $\endgroup$ Mar 2, 2016 at 22:13
  • $\begingroup$ Of all answers, first one here is by far easiest to read and understand for math noobs like me. $\endgroup$
    – m0s
    Mar 4, 2016 at 0:40

Of course, you could always use $$\{ x \in \mathbb{Z} : \text{$x$ is not a multiple of $7$} \}$$

If you think the notation will get in the way of what you're trying to say, then discard the notation!


The most accurate translation of the English condition would be $$ \left\{n\in\mathbb{Z}:\frac n7\not\in\mathbb{Z}\right\} $$

  • $\begingroup$ This is also very succint and clear. +1 $\endgroup$
    – rubenvb
    Mar 6, 2016 at 13:44

I think the vertical line should be used in sets. This is how it's usually done:

$$\{x \in \mathbb{Z} \mid \forall z \in \mathbb{Z}: x \neq 7z \}$$

First part naming some elements, then after the pipe comes the conditions for those elements. I actually have never seen the colon used instead of the pipe before in any lecture material or mathematical book. I think their usage is different.

$$\{x \in \mathbb{Z} \mid 7 \nmid x \}$$

Is another shorter form, but as others said, it required knowledge of the $\nmid$ symbol.

  • 1
    $\begingroup$ I don't think you should make the vertical line do double duty as both such that and divides in the same breath. $\endgroup$
    – Era
    Mar 3, 2016 at 17:05
  • 2
    $\begingroup$ @Zelphir - Your experience is rather limited, then. ":" is the older notation. It is less popular now, but as Era points out, if "|" is being used for some other purpose in the expression, many people will fall back on ":" as the "such that" so as to avoid confusion. $\endgroup$ Mar 3, 2016 at 18:20
  • $\begingroup$ @PaulSinclair Aha, thanks, didn't know that! $\endgroup$ Mar 4, 2016 at 1:07

Another possibility (more wordy but to me clearer):

$$\{x \in ℤ:x \neq 7k \quad \forall k∈ℤ\}$$

  • 2
    $\begingroup$ Isn't this almost the same as the first line in the question? $\endgroup$ Mar 2, 2016 at 8:26
  • 5
    $\begingroup$ Yes but to my eyes at least this is the clearest answer as it uses the least technical notation. $\endgroup$
    – Simon S
    Mar 2, 2016 at 8:29
  • 9
    $\begingroup$ A professor of mine strongly disliked notation like this due to $k$ being used before it is defined. $\endgroup$
    – filmor
    Mar 2, 2016 at 14:20
  • $\begingroup$ @filmor that is quite strange, since this is standard notation $\endgroup$
    – user
    Mar 2, 2016 at 14:30
  • 14
    $\begingroup$ @user I don't believe it is standard to write the forall symbol after its use. It is certainly common in spoken English to say e.g. "$x$ is not equal to $7k$ for any $k$", but $x\ne7k\ \forall k\in\Bbb Z$ is just plain wrong, and is downright misleading if it's not the only quantifier (how to parse $\exists x\in\Bbb Z, x\ne7k\ \forall k\in\Bbb Z$?). Quantifier symbols always precede their formulas, with appropriate parentheses to delimit their scope if necessary. $\endgroup$ Mar 2, 2016 at 18:38

The only issue with what you wrote is that you didn't specify what set the $x$ should come from. For example, $x$ could be $1.5$, since $1.5$ isn't an integer multiple of 7. More correct would be

$$ \{ x\in \mathbb{Z} : (\forall k \in \mathbb{Z})(\neg(7k = x)) \}$$

Of course, in terms of simplicity, as others have noted, there are more compact notations for divisibility that you can use.


What about: {7j+k (∀j∈Z) (∀k∈{1,2,3,4,5,6})} ?


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