# Primes and the factorial

Conjectures:

For all prime numbers $p>5$ there exist a prime number $q<p$ such that $q\equiv m!\!\pmod p$, for some $m$ with $2<m<p$.

and

For all primes $p$ there is a prime $q<p^2$ such that $q\equiv m!\pmod {p^2}$, for some $m$ with $2<m<p^2$. (Even $2<m<p$ as pointed out in comment).

Both tested for all $p<100,000,000$.

There are reasons to believe that the conjectures are true. If $p$ is a large prime there are a lot of nonzero solutions to $n\equiv m!\!\pmod p$ and to $n\equiv m!\!\pmod {p^2}$. The probability for one of those $n$ to be a prime increase with p.

• If $p$ is prime then $m!\equiv0\bmod{p^2}$ for all $m\ge2p$, indeed $m!$ is divisible by $p$ for all $m\ge p$, and there is no prime $q$ satisfying either condition except $q=p$. – Gerry Myerson Jul 6 '16 at 5:43
• @GerryMyerson: yes, the condition for $m$ in the second conjecture could be $2<m<p$. The statement "It exist a prime $q<n$ so that $q\equiv m!\pmod n$, for some $m$ with $2<m<n$" is true for almost 1/3 of all numbers $n$, as it seems, and I wanted to expose the general form. – Lehs Jul 6 '16 at 6:06