OFFSET
1,3
COMMENTS
a(n) = 0 iff the n-th non-Wilson prime is a Wieferich-non-Wilson prime A197635. For example a(1) = a(2) = 0, so the 1st and 2nd non-Wilson primes 2 and 3 are Wieferich-non-Wilson primes. The next one is 14771, which is the 1728th non-Wilson prime, so the next zero in the sequence occurs at a(1728) = 0.
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
EXAMPLE
The 3rd non-Wilson prime is 7, and A197633(3) = 170578899504 == 6 (mod 7), so a(3) = 6.
MATHEMATICA
nmax = 63; nonWilsonQ[p_] := Mod[((p-1)! + 1)/p, p] != 0; nwp = Select[ Prime[ Range[nmax + 2]], nonWilsonQ]; A197633[n_] := With[{p = nwp[[n]]}, ((((p-1)! + 1)/p)^(p-1) - 1)/p]; a[n_] := Mod[A197633[n], nwp[[n]]]; Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Oct 10 2012 *)
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Jonathan Sondow, Oct 16 2011
STATUS
approved