OFFSET
1,1
COMMENTS
All primes except 5, 13, 563, and any other Wilson prime A007540 that may exist.
Same as primes p that do not divide their Wilson quotient ((p-1)!+1)/p.
Wilson's theorem says that (p-1)! == -1 (mod p) if and only if p is prime.
p = prime(i) is a term iff A250406(i) != 0. - Felix Fröhlich, Jan 24 2016
LINKS
E. Costa, R. Gerbicz and D. Harvey, A search for Wilson primes, Mathematics of Computation, 83 (2014), 3071-3091 (arXiv:1209.3436 [math.NT], 2012).
Jonathan Sondow, Lerch Quotients, Lerch Primes, Fermat-Wilson Quotients, and the Wieferich-non-Wilson Primes 2, 3, 14771, in Proceedings of CANT 2011, arXiv:1110.3113 [math.NT], 2011-2012.
Jonathan Sondow, Lerch Quotients, Lerch Primes, Fermat-Wilson Quotients, and the Wieferich-non-Wilson Primes 2, 3, 14771, Combinatorial and Additive Number Theory, CANT 2011 and 2012, Springer Proc. in Math. & Stat., vol. 101 (2014), pp. 243-255.
FORMULA
((p-1)!+1)/p =/= 0 (mod p), where p is prime.
EXAMPLE
2 is a non-Wilson prime since (2-1)! = 1 ==/== -1 (mod 2^2).
MATHEMATICA
Select[Prime@ Range@ 104, Mod[Factorial[# - 1], #^2] != #^2 - 1 &] (* Michael De Vlieger, Jan 24 2016 *)
PROG
(PARI) forprime(p=1, 500, if(Mod((p-1)!, p^2)!=-1, print1(p, ", "))) \\ Felix Fröhlich, Jan 24 2016
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Jonathan Sondow, Oct 19 2011
STATUS
approved