Lerch Quotients, Lerch Primes, Fermat-Wilson Quotients, and the   Wieferich-non-Wilson Primes 2, 3, 14771
  The Fermat quotient $q_p(a):=(a^{p-1}-1)/p$, for prime $p\nmid a$, and the Wilson quotient $w_p:=((p-1)!+1)/p$ are integers. If $p\mid w_p,$ then $p$ is a Wilson prime. For odd $p,$ Lerch proved that $(\sum_{a=1}^{p-1} q_p(a) - w_p)/p$ is also an integer; we call it the Lerch quotient $\ell_p.$ If $p\mid\ell_p$ we say $p$ is a Lerch prime. A simple Bernoulli-number test for Lerch primes is proven. There are four Lerch primes 3, 103, 839, 2237 up to $3\times10^6$; we relate them to the known Wilson primes 5, 13, 563. Generalizations are suggested. Next, if $p$ is a non-Wilson prime, then $q_p(w_p)$ is an integer that we call the Fermat-Wilson quotient of $p.$ The GCD of all $q_p(w_p)$ is shown to be 24. If $p\mid q_p(a),$ then $p$ is a Wieferich prime base $a$; we give a survey of them. Taking $a=w_p,$ if $p\mid q_p(w_p)$ we say $p$ is a Wieferich-non-Wilson prime. There are three up to $10^7$, namely, 2, 3, 14771. Several open problems are discussed. 
Jonathan Sondow
math.NT math.HO