GCD with Prime

Theorem
Let $p$ be a prime number.

Then:
 * $\forall n \in \Z: \gcd \left\{{n, p}\right\} = \begin{cases}

p & : p \mathrel \backslash n \\ 1 & : p \nmid n \end{cases}$

Proof
The only divisors of $p$ are $1$ and $p$ itself by definition.

$\gcd \left\{{n, p}\right\} = p$ precisely when $p$ divides $n$.

Hence the result.