# Set notation that apparently describes prime numbers?

$$B = \{x \in \mathbb{N} | \ \ x \; mod \ y = 0 \Rightarrow y = 1 \ or \ y = x, x > 1, y \in \mathbb{N}\}$$

I just couldn't wrap my head around as to why this set describes a set of prime numbers.

Anybody could explain this in further detail?

Thanks for help.

• The conditions tell us that any (positive) divisor of $x>1$ must be either $1$ or $x$, which is the definition of a prime.
– lulu
Feb 18 '19 at 20:38

"If natural number $$x > 1$$ is divisible by a natural number $$y$$, then $$y$$ is either equal to $$1$$ or equal to $$x$$."
$$x \mod y = 0$$ means that $$y$$ divides $$x$$. So this is the set of all numbers $$x > 1$$ such that the only numbers $$y$$ that divide $$x$$ are $$y=1$$ and $$y=x$$.
It says that a natural number $$x$$ (presumably natural numbers start at 1 in this text) is prime if (1) it's greater than $$1$$, and (2) whenever it's divisible by a natural number $$y$$, then either $$y$$ is $$1$$ OR $$y$$ is $$x$$.
Since the definition of "$$x$$ is prime" is that it's a natural number greater than $$1$$ that divisible only by $$1$$ and itself, that's the same thing.
The only tricky thing here is remembering that $$x \bmod y = 0$$ means that $$y$$ divides evenly into $$x$$ (i.e., $$y$$ is a factor of $$x$$, or $$x$$ is divisible by $$y$$).