# Proth's theorem

Let $n = h*2^k+1$ and $h\lt 2^k$; then $n$ is prime if (and only if) there is an integer $a$ such that
$a^{(n-1)/2} \equiv -1 (mod\,n)$.