OFFSET
1,3
COMMENTS
A Wilson prime is a prime p that divides its Wilson quotient w_p (see A007619). The known Wilson primes are 5, 13, 563 (see A007540).
If p is a non-Wilson prime (see A197636), then p does not divide w_p, and so by Fermat's little theorem the Fermat quotient q_p(w_p) is an integer.
The next term is the Fermat-Wilson quotient of 17, which has 193 digits.
The Fermat-Wilson quotient of 14771 (see A197635) has over 800 million digits.
The GCD of all Fermat-Wilson quotients is 24. In particular, q_p(w_p) is never prime.
LINKS
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
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
a(n) = ((((p-1)!+1)/p)^(p-1)-1)/p, where p = A197636(n).
EXAMPLE
The 3rd non-Wilson prime is 7, so a(3) = (((6!+1)/7)^6-1)/7 = 170578899504.
MATHEMATICA
nmax=4; nonWilsonQ[p_] := Mod[((p-1)!+1)/p , p] != 0; A197636 = Select[ Prime[ Range[nmax+2]], nonWilsonQ]; a[n_] := With[{p=A197636[[n]]}, ((((p-1)!+1)/p)^(p-1)-1)/p]; Table[ a[n], {n, 1, nmax}] (* Jean-François Alcover, Dec 14 2011 *)
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Jonathan Sondow, Oct 16 2011
STATUS
approved