> **Possible Duplicate:** > [Primes P such that ((P-1)/2)!=1 mod P](https://mathoverflow.net/questions/16141/primes-p-such-that-p-1-21-mod-p) Motivation comes from comments in [this question](https://mathoverflow.net/questions/30101/composite-pairs-of-the-form-n-1-and-n1), and it is interesting in its own right. These primes are sequence [A055939](http://www.research.att.com/~njas/sequences/A055939) in OEIS. So, which primes $p$ satisfy $p\\ |\\ (\frac{p-1}{2})! + 1$? If my calculations (in sage) are correct, the following is true for all primes under 100,000. For $p > 3$: $$p\\ |\\ (\frac{p-1}{2})! + 1 \iff h(\sqrt{-p})=1 \mod{4}$$