\documentclass[12pt,reqno]{article}
\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{graphicx}
\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}
\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}
\usepackage{color}
\usepackage{fullpage}
\usepackage{float}
\usepackage{psfig}
\usepackage{graphics}
\usepackage{latexsym}
\usepackage{epsf}
\usepackage{breakurl}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.1in}
\setlength{\textheight}{8.4in}
\newcommand{\seqnum}[1]{\href{https://oeis.org/#1}{\rm \underline{#1}}}
\begin{document}
\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\begin{center}
\vskip 1cm{\Large\bf
On Remarkable Properties of Primes \\
\vskip .1in
Near Factorials and Primorials
}
\vskip 1cm
Anton\'{\i}n \v Cejchan\\
Institute of Physics \\
Czech Academy of Sciences\\
Cukrovarnick\'a 112/10 \\
CZ -- 162 00 Prague 6 \\
Czech Republic\\
\href{mailto:antonin.cejchan@centrum.cz}{\tt antonin.cejchan@centrum.cz}\\
\ \\
Michal K\v r\'{\i}\v zek\\
Mathematical Institute \\
Czech Academy of Sciences\\
\v Zitn\' a 25 \\
CZ -- 115 67 Prague 1 \\
Czech Republic\\
\href{mailto:krizek@math.cas.cz}{\tt krizek@math.cas.cz}\\
\ \\
Lawrence Somer\\
Department of Mathematics \\
Catholic University of America\\
Washington, DC 20064 \\
USA\\
\href{mailto:somer@cua.edu}{\tt somer@cua.edu}
\end{center}
\vskip .2 in
\begin{abstract}
The distribution of primes is quite irregular. However,
it is conjectured that if $p$ is the smallest prime greater than $n!+1$, then $p-n!$
is also prime. We give a sufficient condition that guarantees
when this conjecture is true. In particular, we prove that
if a prime number $p$ satisfies $n!+1
n!+1$, then $p>n!+n$.
\end{lemma}
\begin{proof}
This lemma immediately follows from the fact that the consecutive numbers
$$
n!+2,~n!+3,\dots,~n!+n
$$
are all composite.
\end{proof}
Similarly we can prove the second lemma.
\begin{lemma} \label{L2}
If a prime $p3$, then $p3$ excludes the undesirable initial case $n=p=3$ for which the inequality
$pn$. If a prime $p$ satisfies
\begin{equation}
n!+11$ and
let $p$ be a prime satisfying~(\ref{1}). Assume to the contrary
that $p-n!$ is composite. Then there exist a prime $m$
and an integer $k\ge m$ such that
$$
p-n!=mk.
$$
From this and the inequality $p-n!n!+1>n\ge m$.
\end{proof}
\begin{example} \label{E1} \rm
Let $n=5$. Then $r^2=49$ and for
consecutive primes after $5!$ we have
\begin{align}
5!=120&=127-7=131-11=137-17=139-19=149-29 \nonumber \\[1mm]
&=151-31=157-37=163-43=167-47 \label{2} \\[1mm]
&=173-53=179-59=181-61=191-71=193-73=\underline{197-7\cdot 11}. \nonumber
\end{align}
So all these differences of primes yield the same number $5!=120$.
We observe that there are even more consecutive primes $p>n!+1$ than
those satisfying (\ref{1}) for which $p-n!$ is also prime.
Namely, the inequality (\ref{1}) yields only the first two lines of (\ref{2}), but we can continue
in this manner until the underlined difference (cf.~Table \ref{N1} below for $n=5$).
\end{example}
\begin{theorem} \label{T2}
Let $n>2$ and let $s$ be the largest prime such that $s2$ only guarantees the existence of $s$.
\begin{example} \label{E2} \rm
Take $n=7$ in Theorem \ref{T2}. Then $s^2=25$ and
\begin{align*}
7!&=5040=5039+1=5023+17=5021+19\\[1mm]
&=5011+29=5009+31=5003+37=4999+41=4997+43\\[1mm]
&=4987+53=4973+67=4969+71=4967+73=4957+83\\[1mm]
&=4951+89=4943+97=4937+103=4933+107=4931+109=\underline{4919+11^2} .
\end{align*}
All these sums of primes yield the same number $7!=5040$.
We again get more consecutive primes $p$
than those satisfying (\ref{3}) for which $n!-p$ is prime
until the underlined sum, see the last two columns of Table \ref{N1} and Remark \ref{R2}.
Theorem \ref{T2} thus reminds us of the well-known Goldbach conjecture \cite[p.\,79]{A29}.
\end{example}
\section{Further examples and open problems}
In Figure \ref{F1}, we observe a remarkable distribution of primes near $n!$.
\begin{figure}[H]
\begin{center}
\scalebox{.8}{\vbox{
\hskip3cm$\,\vdots$
\hskip3cm$\bullet~n!+r^2$
\hskip3cm{\Large{$\biggl\{$}} Here for each prime $p$ we have that $p-n!$ is also prime by Theorem \ref{T1}.
\hskip3cm$\bullet~n!+n$
\hskip3cm$\Bigl\{$ There are no primes by Lemma \ref{L1}.
\hskip3cm$\bullet~n!+1$ A possible factorial prime.
\hskip3cm$\bullet~n!$
\hskip3cm$\bullet~n!-1$ A possible factorial prime.
\hskip3cm$\Bigl\{$ There are no primes by Lemma \ref{L2}.
\hskip3cm$\bullet~n!-n$
\hskip3cm{\Large{$\biggl\{$}} Here for each prime $p$ we have that $n!-p$ is also prime by Theorem~\ref{T2}.
\hskip3cm$\bullet~n!-s^2$
\hskip3cm$\,\vdots$
\hskip3cm$\bullet~3$
\hskip3cm$\bullet~2$
\hskip3cm$\bullet~1$
}}
\caption{Distribution of primes near $n!$ for $n>2$.} \label{F1}
\end{center}
\end{figure}
\begin{figure}[H]
\begin{center}
\includegraphics[width=5in]{Factoria.eps}
\end{center}
\caption{The number of consecutive primes $p$ just above $n!+1$
for which $p-n!$ is also prime for all $n\leq 486$.} \label{F2}
\end{figure}
It could happen, however, that the open intervals $(n!+1,n!+r^2)$
and $(n!-s^2,n!-1)$ appearing in (\ref{1}) and (\ref{3})
do not contain any prime number, although no such example is known.
Therefore, Theorems~\ref{T1} and \ref{T2} do not imply that the following
conjectures are true.
\begin{conjecture} \label{C1}
If $p$ is the smallest prime greater than $n!+1$, then $p-n!$ is also prime.
\end{conjecture}
\begin{conjecture} \label{C2}
If $p$ is the largest prime smaller than $n!-1$, then $n!-p$ is also prime.
\end{conjecture}
\begin{remark} \label{R1} \rm
From the well-known Stirling formula \cite[p.\,343]{Rek}
$$
\lim_{n\to\infty}\frac{n!}{n^n{\rm e}^{-n}\sqrt{n}}=\sqrt{2\pi},
$$
we find an asymptotic expression for the factorial
$n!\approx \sqrt{2\pi}\,n^n{\rm e}^{-n}\sqrt{n}$ and thus
$$
\ln(n!)\approx n\ln(n) - n +0.5\ln(n) +0.5\ln(2\pi).
$$
According to the celebrated Gauss prime number theorem \cite{A29},
the probability that $n$ is a prime number is about $1/\ln(n)$. Hence,
consecutive primes on the order of $n!$ should differ by about $\ln(n!)$
which is approximately
\begin{equation}
\ln(n!)=n\ln(n)-n+O(\ln(n))\qquad{\rm as~}n\to\infty, \label{4}
\end{equation}
where $O(\cdot)$ stands for the usual Landau symbol. However, this is by
relation (\ref{4}) much
less than $r^2\quad(>n^2)$ appearing on the right-hand side of (\ref{1}). This
provides support that Conjecture \ref{C1} (and similarly Conjecture \ref{C2}) might be true.
\end{remark}
\begin{example} \label{E3} \rm
Another argument for the validity of Conjectures \ref{C1} and \ref{C2}
are numerical tests. The statements of Theorems \ref{T1} and \ref{T2} for $n=2,3,\dots,10$
are given in Table \ref{N1}.
\begin{table}
\begin{center}
\begin{tabular}{|r|r|r||c|r|} \hline
$n$ & $N_1$ & $N_2$ & $N_3$ & $N_4$\\ \hline
2 & 2 & 2 & $-$ & $-$\\
3 & 6 & 6 & 1 & 1 \\
4 & 6 & 7 & 2 & 6 \\
5 & 9 & 14& 1 & 10\\
6 & 7 & 7 & 2 & 10\\
7 & 12 & 17& 2 & 17\\
8 & 8 & 15& 3 & 10\\
9 & 11 & 18& 3 & 4\\
10& 7 & 11& 5 & 8\\ \hline
\end{tabular}
\end{center}
\caption{Here
$N_1$ denotes the number of primes satisfying (\ref{1}),
$N_2$ is the number of consecutive primes just above $n!+1$ for which $p-n!$ is prime,
$N_3$ is the number of primes satisfying (\ref{3}),
$N_4$ is the number of consecutive primes just below $n!-1$ for which $n!-p$ is prime,
$N_1\leq N_2$, and $N_3\leq N_4$.} \label{N1}
\end{table}
\end{example}
Numerical tests calculated by Maple for all $n\leq 500$
indicate that if $\overline p$ is
the smallest prime greater than $n!+1$ for which
$\overline{p}-n!$ is composite, then $\overline{p}-n!$
is always the product of two not necessarily different primes,
cf.~Tab\-le~2. In Figure \ref{F2}, we see an increasing trend of the number of consecutive primes $p$
above $n!+1$ for which $p-n!$ is also prime.
\begin{table}
\begin{center}
\begin{tabular}{|r|r|r|l|} \hline
$n$ & $N_1$ & $N_2$ & $\overline{p}-n!$ \\ \hline
10 & 7 & 11 & $169=13^2$ \\
50 & 27 & 34 & $3481=59^2$ \\
100 & 30 & 30 & $10201=101^2$ \\
150 & 37 & 48 & $31133=163\cdot 191$ \\
200 & 54 & 89 & $76729=277^2$ \\
250 & 55 & 79 & $88579=283\cdot 313$ \\
300 & 77 &121 & $176959=311\cdot 569$ \\
350 & 76 & 76 & $124609=353^2$ \\
400 & 85 &122 & $242321=443\cdot 547$ \\
450 & 95 &133 & $307297=487\cdot 631$ \\
500 & 95 &105 & $294319=521\cdot 569$ \\ \hline
\end{tabular}
\end{center}
\caption{Here $N_1$ denotes the number of primes satisfying (\ref{1}),
$N_2$ is the number of consecutive primes just above $n!+1$ for which $p-n!$ is also prime,
and $\overline p$ is the smallest prime greater than $n!+1$ for which $\overline{p}-n!$ is composite.} \label{N2}
\end{table}
Another open problem is whether the difference $\overline p-n!$ from the last column
of Table \ref{N2} is always the product of two (not necessarily different) primes that
are greater than $n$.
\begin{remark} \label{R2} \rm
If the upper bound $n!+r^2$ appearing in $(\ref{1})$ is a prime $\tilde p$, then
$N_1=N_2$ in Table~\ref{N1}, since the difference $\tilde p -n!=(n!+r^2)-n!=r^2$ is composite.
Hence, the sequence of consecutive primes $p$ just above $n!+1$,
for which $p-n!$ is also prime, finishes before
$n!+r^2$. For instance, $2!+3^2=11$, $3!+5^2=31$, and $6!+7^2=769$ are primes, cf. Table \ref{N1}
for $n\in\{2,3,6\}$.
Also $100!+101^2$ and $350!+353^2$ are primes, cf.~Table \ref{N2} for $n\in\{100, 350\}$.
On the other hand, the lower bound $n!-s^2$ appearing in (\ref{3}) is never
prime except for the trivial case $n=3$ when $N_3=N_4=1$.
The reason is that $s\mid n!$, and thus $s\mid (n!-s^2)$.
\end{remark}
\begin{remark} \label{R3} \rm
The verification of Conjecture \ref{C1} for any $n\leq 4003$ follows from
sequence \seqnum{A037153}
in the {\it On-Line Encyclopedia of Integer Sequences} (OEIS)
\cite{www}. Also see sequences \seqnum{A033932},
\seqnum{A037151}, and \seqnum{A087421}.
The verification of Conjecture \ref{C2} for $n\leq 1000$ follows from
\seqnum{A037155}. Conjectures \ref{C1} and \ref{C2} are also related to
a paper by Fl\'orez and James \cite{Florez}.
Nevertheless, one has to keep in mind the so-called strong law of small numbers
\cite{Gardner1, Gardner2, Guy5, Guy6, Guy}, when the validity of some apparent regular pattern
is violated for $n\gg 1$.
\end{remark}
Now we will modify our previous results to another class of numbers.
\section{Primes near primorials}
From now on, let $q$ be an arbitrary fixed prime.
Denote by $q\#$ the product of all primes not exceeding $q$,
i.e., $q\#=2\cdot 3\cdot 5\cdots q$.
It is called the {\it primorial} of $q$.
\begin{conjecture} \label{C3}
If $p$ is the smallest prime greater than $q\#+1$, then $p-q\#$ is also prime.
\end{conjecture}
\begin{conjecture} \label{C4}
If $p$ is the largest prime smaller than $q\#-1$, then $q\#-p$ is also prime.
\end{conjecture}
The classical proof of Euclid's theorem on the infinity of primes is
done by contradiction \cite{A29}. It is assumed that there exist
only a finite number of primes and that the largest prime is $q$.
Then one investigates the number $q\#+1$ which leads to a contradiction,
since $q\#+1$ is a new prime or $q\#+1$ is composite and divisible
by a prime greater than $q$.
For this reason, prime numbers of the form $q\#+1$ are called
\it Euclidean primes, \rm see e.g.,\cite{B60}. For example,
$$
2\#+1=3,\quad 3\#+1=7,\quad 5\#+1=31,\quad 7\#+1=211,\quad 11\#+1=2311
$$
are Euclidean primes. However,
not every number of this form is prime, since
$$
13\#+1 = 2\cdot 3\cdot 5\cdot 7 \cdot 11 \cdot 13 + 1 =59\cdot 509.
$$
Note that $q\#+1$ is a Euclidean prime only for
$$
q=2,~3,~5,~7,~11,~31,~379,\dots
$$
Similarly we can investigate
numbers of the form $q\#-1$, which are primes for
$$
q=3,~5,~11,~13,~41,~89,~317,~337,~991,\dots
$$
In this case they are called {\it primorial primes}.
\begin{lemma} \label{L3}
If a prime $p>q\#+1$, then $p>q\#+q$.
\end{lemma}
\begin{proof}
Since the consecutive numbers
$$
q\#+2,~q\#+3,\dots,~q\#+q
$$
are all composite, the lemma follows.
\end{proof}
\smallskip
Similarly we can prove the next lemma.
\begin{lemma} \label{L4}
If a prime $p3$, then $pq\#+1>q\ge m$.
\end{proof}
In a similar way we can prove the following statement.
\begin{theorem} \label{T4}
Let $s2$, $Q_1\leq Q_2$, and $Q_3\leq Q_4$.} \label{N3}
\end{table}
Taking into account that
$$
4!<5\#<5!<7\#<6!<11\#<7!<13\#<8!<17\#<9!<10!<19\#,
$$
we find that
numbers $Q_i$ in particular columns are generally greater than $N_i$ from Table \ref{N1}.
when $(n-1)!< q\#1$ such that for a given prime $q$, $q\#+m$ is a prime number
(see \cite{Gardner1, Gardner2, Golomb, Guy5, Guy} for a discussion of Fortunate numbers). The sequence of Fortunate numbers begins:
3, 5, 7, 13, 23, 17, 19, 23, 37, \dots Conjecture \ref{C3} which was introduced by
Fortune, states that all Fortunate numbers are primes. The verification of Conjecture \ref{C3}
for the first 3000 primes $q$ follows from \seqnum{A005235} (also see
\seqnum{A046066}, \seqnum{A035346}, \seqnum{A098168}).
The verification of Conjecture \ref{C4}
for the first 2000 primes $q$ follows from \seqnum{A055211} (also see
\seqnum{A098166}).
\end{remark}
\begin{remark} \label{R6} \rm
The distribution of primes is quite irregular. However, Theorems \ref{T1}--\ref{T4}
imply that there are some regular patterns. Moreover,
Theorems \ref{T3} and \ref{T4} can be easily extended to the case when $q\#$ is everywhere
substituted by the product $i(q\#)$ for any fixed integer $i\in\mathbb N$. For example,
for $i=31$ and $q=3$ we have $31\cdot 6=186=191-5=193-7=197-11=199-13=\underline{211-5^2}$.
This extension covers the case investigated in Section 1, since we may set $i=n!/q\#$
for some $n\ge q$. See, for example, identities (\ref{2}) for $n=q=5$ yielding $i=120/30=4$.
\end{remark}
\section{Acknowledgments}
The authors are indebted to
Jan Brandts for fruitful suggestions,
Hana B\'{\i}lkov\'a for technical assistance in the final typesetting, and to
Filip K\v r\'{\i}\v zek for drawing Figure \ref{F2}.
Supported by RVO 67985840 of the Czech Republic. The authors also thank the
anonymous referee for careful reading of the paper and suggestions which improved the paper.
\begin{thebibliography}{99}
\bibitem{Florez}
R. Fl\'orez and L. Junes,
A relation between triangular numbers and prime numbers,
{\it Integers} {\bf 12} (2012), 83--96.
\bibitem{Gardner1}
M. Gardner,
Patterns in primes are a clue to the strong law of small numbers,
{\it Sci. Amer.} {\bf 243} (6) (1980), 18--28.
\bibitem{Gardner2}
M. Gardner,
{\it The Last Recreations},
Copernicus, 1997.
\bibitem{Golomb}
S. W. Golomb,
The evidence for Fortune's conjecture.
{\it Math. Mag.} {\bf 54} (1981), 209--210.
\bibitem{Guy5}
R. K. Guy,
The strong law of small numbers,
{\it Amer. Math. Monthly} {\bf 95} (1988), 697--712.
\bibitem{Guy6}
R. K. Guy,
The second strong law of small numbers,
{\it Math. Mag.} {\bf 63} (1990), 3--20.
\bibitem{Guy}
R. K. Guy,
{\it Unsolved Problems in Number Theory}, 3rd edition,
Springer-Verlag, 2004.
\bibitem{B60}
M. K\v r\'{\i}\v zek and L. Somer,
Euclidean primes have the minimum number of primitive roots,
{\it JP J. Algebra Number Theory Appl.} {\bf 12} (2008), 121--127.
\bibitem{A29}
M. K\v r\'{\i}\v{z}ek, L. Somer, and A. \v Solcov\'a,
{\it From Great Discoveries in Number Theory to Applications},
Springer, 2021.
\bibitem{Rek}
K. Rektorys,
{\it Survey of Applicable Mathematics}, Vol.~1, Kluwer Acad. Publ. Group, 1994.
\bibitem{www} N. J. A. Sloane et al.,
{\it The On-Line Encyclopedia of Integer Sequences},
available at \url{https://oeis.org}, 2022.
\end{thebibliography}
\bigskip
\hrule
\bigskip
\noindent 2010 {\it Mathematics Subject Classification}:
Primary 11A41; Secondary 11N05.
\noindent \emph{Keywords: }
factorial prime, Euclidean prime, primorial prime, Fortunate number,
Stirling formula, Gauss prime number theorem.
\bigskip
\hrule
\bigskip
\noindent (Concerned with sequences
\seqnum{A005235},
\seqnum{A033932},
\seqnum{A035346},
\seqnum{A037151},
\seqnum{A037153},
\seqnum{A037155},
\seqnum{A046066},
\seqnum{A055211},
\seqnum{A087421},
\seqnum{A098166}, and
\seqnum{A098168}.)
\bigskip
\hrule
\bigskip
\vspace*{+.1in}
\noindent
Received November 11 2021;
revised version received January 3 2022; January 10 2022.
Published in {\it Journal of Integer Sequences}, January 10 2022.
\bigskip
\hrule
\bigskip
\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{https://cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in
\end{document}