Problem Statement
Let $S$ be the set of all $m\geq 1$ such that there exists a prime $p\not\equiv 1\pmod{m}$ such that $m!+1\equiv 0\pmod{p}$. Does\[\lim \frac{\lvert S\cap [1,x]\rvert}{x}\]exist? What is it?
Similarly, if $P$ is the set of all primes $p$ such that there exists an $m$ with $p\not\equiv 1\pmod{m}$ such that $m!+1\equiv 0\pmod{p}$, then does\[\lim \frac{\lvert P\cap [1,x]\rvert}{\pi(x)}\]exist? What is it?
Similarly, if $P$ is the set of all primes $p$ such that there exists an $m$ with $p\not\equiv 1\pmod{m}$ such that $m!+1\equiv 0\pmod{p}$, then does\[\lim \frac{\lvert P\cap [1,x]\rvert}{\pi(x)}\]exist? What is it?
Categories:
Number Theory
Progress
Questions raised by Erdős, Hardy, and Subbarao, who called the set $S$ 'EHS numbers' and the set $P$ 'Pillai primes', and proved that both $S$ and $P$ are infinite. Pillai [Pi30] raised the question of whether there exist any primes in $P$. This was answered by Chowla, who noted that, for example,\[14!+1\equiv 18!+1\equiv 0\pmod{23}.\]The sequence $S$ begins\[8,9,13,14,15,16,17,\ldots\]and is A064164 in the OEIS. The sequence $P$ begins\[23,29,59,61,67,71,\ldots\]and is A063980 in the OEIS.Regarding the first question, Hardy and Subbarao computed all EHS numbers up to $2^{10}$, and write '...if this trend conditions we expect [the limit] to be around $0.5$, if it exists. The frequency with which the EHS numbers occur - most often in long sequences of consecutive integers - makes us believe that their asymptotic density exists and is unity. Erdős, though initially hesitant, later agreed with this view.'
Regarding the second question, they write '[from the data] it would appear that if the limit exists, it is perhaps between $0.5$ and $0.6$. But then there seems to be no reason why the ratio should not tend to $1$, even though very slowly and certainly not monotonically.'
This is discussed in problem A2 of Guy's collection [Gu04].
Source: erdosproblems.com/1074 | Last verified: January 19, 2026