OFFSET
1,1
COMMENTS
The Wilson theorem states that p is prime if and only if (p-1)! = -1 (mod p). If p = 3 (mod 4) then ((p-1)/2)! = +/- 1 (mod p).
REFERENCES
J. B. Cosgrave, A Mersenne-Wieferich Odyssey, Manuscript, May 2022. See Section 18.2.
LINKS
J. B. Cosgrave, Jacobi [From Francois Brunault (brunault(AT)gmail.com), Nov 29 2008]
Wikipedia, Wilson's theorem
EXAMPLE
For n = 1 the prime a(1) = 3571 divides 1190! - 1.
PROG
(PARI) forprime(p=2, 30000, if(p%3==1 & ((p-1)/3)!%p==1, print(p)))
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Francois Brunault (brunault(AT)gmail.com), Nov 29 2008, Nov 30 2008
STATUS
approved