TITLE: Characterizations of primes
QUESTION [6 upvotes]: Let $\mathbb{P}$ be the primes set.
We know from Wilson's Theorem that
$$(p-1)!\equiv-1 \pmod p \iff p \in \mathbb{P}$$
What another formulas we have with an if and only if ($\iff$) statement to characterize primes, not equivalent or derived from Wilson's Theorem?
(I'm not asking about algorithms to primality tests, but rather expressions that hold exactly for primes using algebra, modulus, integrals and another things).
Or expressions like:
$p \in \mathbb{P} \iff$ Expression using p

REPLY [4 votes]: Very simple, but included for the sake of completeness: ($n$ is prime) if and only if ([$n\gt1$] and [{if $n$ divides $ab$} then {<$n$ divides $a$> or <$n$ divides $b$>}]). 
Elevated from a comment, since OP has indicated it's the kind of thing wanted: Giuga's conjecture states that $n$ is prime if and only if $1^{n-1}+2^{n-1}+\cdots+(n-1)^{n-1}\equiv-1\pmod n$.