On Remarkable Properties of Primes Near Factorials and Primorials

Antonín Čejchan Institute of Physics Czech Academy of Sciences Cukrovarnická 112/10 CZ – 162 00 Prague 6 Czech Republic

                    antonin.cejchan@centrum.cz

Michal Křížek Mathematical Institute Czech Academy of Sciences Žitná 25 CZ – 115 67 Prague 1 Czech Republic

                        krizek@math.cas.cz

Lawrence Somer Department of Mathematics Catholic University of America Washington, DC 20064 USA

                          somer@cua.edu

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 < p < n! + r^{2}, where r is the smallest prime larger than a given natural number n, then p − n! is also a prime. Similarly we treat another conjecture: If p is the largest prime smaller than n!−1, then n!−p is also prime. Then we establish further sufficient conditions also for the case when n! is replaced by q#, which is the product of all primes not exceeding the prime q.

1 Primes near factorials

Throughout this paper let n ∈ ℕ be an arbitrary fixed natural number. Let n! = 1 · 2 ⋯ n be its factorial.

Our main results are contained in Theorems 3,5,17, and 18. First, we present two wellknown lemmas which illustrate that there are no primes in a close neighborhood above n!+1 and below n! − 1.

Lemma 1. If a prime p > n! + 1, then p > n! + n.

Proof. This lemma immediately follows from the fact that the consecutive numbers

n! + 2, n! + 3, …, n! + n

are all composite.

Similarly we can prove the second lemma.

Lemma 2. If a prime p < n! − 1 and n > 3, then p < n! − n.

The assumption n > 3 excludes the undesirable initial case n = p = 3 for which the inequality p < n! − n is obviously not valid.

Recall [9] that primes of the form n! + 1 are said to be factorial primes. For instance, if

n = 1, 2, 3, 11, 27, 37, 41, 73, 77, 116, 154, 320, 340, 399, 427, 872, …

then n! + 1 is prime. Primes of the form n! − 1 are also called factorial primes. We get them for

n = 3, 4, 6, 7, 12, 14, 30, 32, 33, 38, 94, 166, 324, 379, 469, 546, 974, …

Now we present the first of our main theorems.

Theorem 3. Let r be the smallest prime such that r > n. If a prime p satisfies

n! + 1 < p < n! + r^{2},  (1)

then p − n! is also prime.

Proof. The case n = 1 is obvious. So let n > 1 and let p be a prime satisfying (1). Assume to the contrary that p − n! is composite. Then there exist a prime m and an integer k ≥ m such that

p − n! = mk.

From this and the inequality p − n! < r^{2} from (1), we observe that m < r and therefore, the prime m satisfies the inequality m ≤ n. Since m | n! and m | (p − n!), we find that m | p, which contradicts the assumption that p is prime and the fact that p > n! + 1 > n ≥ m.

Example 4. Let n = 5. Then r^{2} = 49 and for consecutive primes after 5! we have

5! = 120 = 127 − 7 = 131 − 11 = 137 − 17 = 139 − 19 = 149 − 29
= 151 − 31 = 157 − 37 = 163 − 43 = 167 − 47  (2)
= 173 − 53 = 179 − 59 = 181 − 61 = 191 − 71 = 193 − 73 = \underline{197 − 7 · 11}.

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 (1) for which p − n! is also prime. Namely, the inequality (1) yields only the first two lines of (2), but we can continue in this manner until the underlined difference (cf. Table 1 below for n = 5).

Theorem 5. Let n > 2 and let s be the largest prime such that s < n. If a prime p satisfies

n! − s^{2} < p < n! − 1,  (3)

then n! − p is also prime.

The proof is done similarly as in Theorem 3. The additional assumption n > 2 only guarantees the existence of s.

Example 6. Take n = 7 in Theorem 5. Then s^{2} = 25 and

7! = 5040 = 5039 + 1 = 5023 + 17 = 5021 + 19

= 5011 + 29 = 5009 + 31 = 5003 + 37 = 4999 + 41 = 4997 + 43

= 4987 + 53 = 4973 + 67 = 4969 + 71 = 4967 + 73 = 4957 + 83

= 4951 + 89 = 4943 + 97 = 4937 + 103 = 4933 + 107 = 4931 + 109 = \underline{4919 + 11^{2}}.

All these sums of primes yield the same number 7! = 5040. We again get more consecutive primes p than those satisfying (3) for which n! − p is prime until the underlined sum, see the last two columns of Table 1 and Remark 11. Theorem 5 thus reminds us of the well-known Goldbach conjecture [9, p. 79].

2 Further examples and open problems

In Figure 1, we observe a remarkable distribution of primes near n!.

⋮

• n! + r^{2}

{ Here for each prime p we have that p − n! is also prime by Theorem 3.

• n! + n

{ There are no primes by Lemma 1.

• n! + 1 A possible factorial prime. • n!

• n! − 1 A possible factorial prime. { There are no primes by Lemma 2.

• n! − n

{ Here for each prime p we have that n! − p is also prime by Theorem 5.

• n! − s^{2} ⋮

• 3 • 2 • 1

Figure 1: Distribution of primes near n! for n > 2.

Figure 2: The number of consecutive primes p just above n!+1 for which p−n! is also prime for all n ≤ 486.

It could happen, however, that the open intervals (n! + 1, n! + r^{2}) and (n! − s^{2}, n! − 1) appearing in (1) and (3) do not contain any prime number, although no such example is known. Therefore, Theorems 3 and 5 do not imply that the following conjectures are true.

Conjecture 7. If p is the smallest prime greater than n! + 1, then p − n! is also prime.

Conjecture 8. If p is the largest prime smaller than n! − 1, then n! − p is also prime.

Remark 9. From the well-known Stirling formula [10, p. 343]

lim_{n→∞} \frac{n!}{n^{n}e^{−n}\sqrt{n}} = \sqrt{2π},

we find an asymptotic expression for the factorial n! ≈ \sqrt{2π} n^{n}e^{−n}\sqrt{n} and thus

ln(n!) ≈ n ln(n) − n + 0.5 ln(n) + 0.5 ln(2π).

According to the celebrated Gauss prime number theorem [9], 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

ln(n!) = n ln(n) − n + O(ln(n)) as n → ∞,  (4)

where O(·) stands for the usual Landau symbol. However, this is by relation (4) much less than r^{2} (> n^{2}) appearing on the right-hand side of (1). This provides support that Conjecture 7 (and similarly Conjecture 8) might be true.

Example 10. Another argument for the validity of Conjectures 7 and 8 are numerical tests. The statements of Theorems 3 and 5 for n = 2, 3, …, 10 are given in Table 1.

Numerical tests calculated by Maple for all n ≤ 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. Table 2. In Figure 2, we see an increasing trend of the number of consecutive primes p above n! + 1 for which p − n! is also prime.

Another open problem is whether the difference \overline{p} − n! from the last column of Table 2 is always the product of two (not necessarily different) primes that are greater than n.

Remark 11. If the upper bound n! + r^{2} appearing in (1) is a prime p̃, then N_{1} = N_{2} in Table 1, since the difference 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 1 for n ∈ {2, 3, 6}. Also 100! + 101^{2} and 350! + 353^{2} are primes, cf. Table 2 for n ∈ {100, 350}.

On the other hand, the lower bound n! − s^{2} appearing in (3) is never prime except for the trivial case n = 3 when N_{3} = N_{4} = 1. The reason is that s | n!, and thus s | (n! − s^{2}).

\begin{matrix}n & N_{1} & N_{2} & N_{3} & N_{4} \\ 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 \end{matrix}

Table 1: Here N_{1} denotes the number of primes satisfying (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 (3), N_{4} is the number of consecutive primes just below n! − 1 for which n! − p is prime, N_{1} ≤ N_{2}, and N_{3} ≤ N_{4}.

\begin{matrix}n & N_{1} & N_{2} & \overline{p} − n! \\ 10 & 7 & 11 & 169 = 13^{2} \\ 50 & 27 & 34 & 3481 = 59^{2} \\ 100 & 30 & 30 & 10201 = 101^{2} \\ 150 & 37 & 48 & 31133 = 163 · 191 \\ 200 & 54 & 89 & 76729 = 277^{2} \\ 250 & 55 & 79 & 88579 = 283 · 313 \\ 300 & 77 & 121 & 176959 = 311 · 569 \\ 350 & 76 & 76 & 124609 = 353^{2} \\ 400 & 85 & 122 & 242321 = 443 · 547 \\ 450 & 95 & 133 & 307297 = 487 · 631 \\ 500 & 95 & 105 & 294319 = 521 · 569 \end{matrix}

Table 2: Here N_{1} denotes the number of primes satisfying (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.

Remark 12. The verification of Conjecture 7 for any n ≤ 4003 follows from sequence \underline{A037153} in the On-Line Encyclopedia of Integer Sequences (OEIS) [11]. Also see sequences \underline{A033932}, \underline{A037151}, and \underline{A087421}. The verification of Conjecture 8 for n ≤ 1000 follows from \underline{A037155}. Conjectures 7 and 8 are also related to a paper by Flórez and James [1]. Nevertheless, one has to keep in mind the so-called strong law of small numbers [2, 3, 5, 6, 7], when the validity of some apparent regular pattern is violated for n ≫ 1.

Now we will modify our previous results to another class of numbers.

3 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 · 3 · 5 ⋯ q. It is called the primorial of q.

Conjecture 13. If p is the smallest prime greater than q# + 1, then p − q# is also prime.

Conjecture 14. If p is the largest prime smaller than q# − 1, then q# − p is also prime.

The classical proof of Euclid’s theorem on the infinity of primes is done by contradiction [9]. 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 Euclidean primes, see e.g.,[8]. For example,

2# + 1 = 3, 3# + 1 = 7, 5# + 1 = 31, 7# + 1 = 211, 11# + 1 = 2311

are Euclidean primes. However, not every number of this form is prime, since

13# + 1 = 2 · 3 · 5 · 7 · 11 · 13 + 1 = 59 · 509.

Note that q# + 1 is a Euclidean prime only for

q = 2, 3, 5, 7, 11, 31, 379, …

Similarly we can investigate numbers of the form q# − 1, which are primes for

q = 3, 5, 11, 13, 41, 89, 317, 337, 991, …

In this case they are called primorial primes.

Lemma 15. If a prime p > q# + 1, then p > q# + q.

Proof. Since the consecutive numbers

q# + 2, q# + 3, …, q# + q

are all composite, the lemma follows.

Similarly we can prove the next lemma.

Lemma 16. If a prime p < q# − 1 and q > 3, then p < q# − q.

Theorem 17. Let q < r be consecutive primes. If a prime p satisfies

q# + 1 < p < q# + r^{2},  (5)

then p − q# is also prime.

Proof. We shall proceed similarly as in the proof of Theorem 3. Let p be a prime satisfying (5). Suppose to the contrary that p − q# is composite. Then there exist a prime m and an integer k ≥ m such that

p − q# = mk.  (6)

From this and the inequality p − q# < r^{2} arising from (5), we see that mk < r^{2} and thus m ≤ q < r. Since m | q# and m | (p−q#) by (6), we find that m | p which is a contradiction with the assumption that p is prime and the fact that p > q# + 1 > q ≥ m.

In a similar way we can prove the following statement.

Theorem 18. Let s < q be consecutive primes. If a prime p satisfies

q# − s^{2} < p < q# − 1,  (7)

then q# − p is also prime.

Example 19. To illustrate the meaning of Lemmas 15 and 16 and also Theorems 17 and 18, we set q = 13. We observe similar remarkable properties of consecutive primes near q# ± 1 as in Examples 4 and 6, namely,

13# = 30030 = 30047 − 17 = 30059 − 29 = 30071 − 41 = 30089 − 59 = 30091 − 61

= 30097 − 67 = 30103 − 73 = 30109 − 79 = 30113 − 83 = 30119 − 89 = 30133 − 103 = 30137 − 107 = 30139 − 109 = 30161 − 131 = 30169 − 139 = 30181 − 151 = 30187 − 157 = 30197 − 167 = 30203 − 173 = 30211 − 181 = 30223 − 193 = 30241 − 211 = 30253 − 223 = 30259 − 229 = 30269 − 239 = 30271 − 241 = 30293 − 263 = 30307 − 277 = 30313 − 283 = \underline{30319 − 17^{2}},

13# = 30030 = 30029 + 1 = 30013 + 17 = 30011 + 19 = 29989 + 41 = 29983 + 47

= 29959 + 71 = 29947 + 83 = 29927 + 103 = 29921 + 109 = 29917 + 113 = 29881 + 149 = 29879 + 151 = 29873 + 157 = 29867 + 163 = 29863 + 167 = 29851 + 179 = 29837 + 193 = 29833 + 197 = 29819 + 211 = 29803 + 227 = 29789 + 241 = 29761 + 269 = 29759 + 271 = 29753 + 277 = \underline{29741 + 17^{2}}.

\begin{matrix}n & Q_{1} & Q_{2} & Q_{3} & Q_{4} \\ 2 & 2 & 2 & − & − \\ 3 & 6 & 6 & 1 & 1 \\ 5 & 10 & 10 & 1 & 6 \\ 7 & 19 & 19 & 4 & 22 \\ 11 & 23 & 25 & 7 & 19 \\ 13 & 29 & 29 & 9 & 23 \\ 17 & 25 & 36 & 10 & 33 \\ 19 & 38 & 42 & 20 & 32 \end{matrix}

Table 3: Here Q_{1} denotes the number of primes satisfying (5), Q_{2} is the number of consecutive primes just above q# + 1 for which p − q# is prime, Q_{3} is the number of primes satisfying (7), Q_{4} is the number of consecutive primes just below q# − 1 for which q# − p is prime, where q > 2, Q_{1} ≤ Q_{2}, and Q_{3} ≤ Q_{4}.

Figure 1 can be easily modified to primes near q#. Also Table 3 corresponding to these primes is similar to Table 1.

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 1. when (n − 1)! < q# < n!.

Remark 20. If the upper bound q#+r^{2} appearing in (5) is a prime p̃, then Q_{1} = Q_{2} in Table 3, since the difference p̃ − q# = (q# + r^{2}) − q# = r^{2} is composite. Hence, the sequence of consecutive primes p just above q# + 1, for which p − q# is also prime, finishes before q# + r^{2}. For instance, 2# + 3^{2} = 11, 3# + 5^{2} = 31, 5# + 7^{2} = 79, 7# + 11^{2} = 331, and 13# + 17^{2} = 30319 are primes, cf. Table 3 for q ∈ {2, 3, 5, 7, 13}.

On the other hand, the lower bound q# − s^{2} appearing in (7) is never prime except for the trivial case q = 3 when Q_{3} = Q_{4} = 1. The reason is that s | q#, and thus s | (q# − s^{2}).

Remark 21. We note that a Fortunate number, named after Reo Franklin Fortune, is the smallest integer m > 1 such that for a given prime q, q# + m is a prime number (see [2, 3, 4, 5, 7] for a discussion of Fortunate numbers). The sequence of Fortunate numbers begins: 3, 5, 7, 13, 23, 17, 19, 23, 37, … Conjecture 13 which was introduced by Fortune, states that all Fortunate numbers are primes. The verification of Conjecture 13 for the first 3000 primes q follows from \underline{A005235} (also see \underline{A046066}, \underline{A035346}, \underline{A098168}). The verification of Conjecture 14 for the first 2000 primes q follows from \underline{A055211} (also see \underline{A098166}).

Remark 22. The distribution of primes is quite irregular. However, Theorems 3–18 imply that there are some regular patterns. Moreover, Theorems 17 and 18 can be easily extended to the case when q# is everywhere substituted by the product i(q#) for any fixed integer i ∈ ℕ. For example, for i = 31 and q = 3 we have 31 · 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 ≥ q. See, for example, identities (2) for n = q = 5 yielding i = 120/30 = 4.

4 Acknowledgments

The authors are indebted to Jan Brandts for fruitful suggestions, Hana Bílková for technical assistance in the final typesetting, and to Filip Křížek for drawing Figure 2. 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.

References

[1] R. Flórez and L. Junes, A relation between triangular numbers and prime numbers, Integers 12 (2012), 83–96.

[2] M. Gardner, Patterns in primes are a clue to the strong law of small numbers, Sci. Amer. 243 (6) (1980), 18–28.

[3] M. Gardner, The Last Recreations, Copernicus, 1997.

[4] S. W. Golomb, The evidence for Fortune’s conjecture. Math. Mag. 54 (1981), 209–210.

[5] R. K. Guy, The strong law of small numbers, Amer. Math. Monthly 95 (1988), 697–712.

[6] R. K. Guy, The second strong law of small numbers, Math. Mag. 63 (1990), 3–20.

[7] R. K. Guy, Unsolved Problems in Number Theory, 3rd edition, Springer-Verlag, 2004.

[8] M. Křížek and L. Somer, Euclidean primes have the minimum number of primitive roots, JP J. Algebra Number Theory Appl. 12 (2008), 121–127.

[9] M. Křížek, L. Somer, and A. Šolcová, From Great Discoveries in Number Theory to Applications, Springer, 2021.

[10] K. Rektorys, Survey of Applicable Mathematics, Vol. 1, Kluwer Acad. Publ. Group, 1994.

[11] N. J. A. Sloane et al., The On-Line Encyclopedia of Integer Sequences, available at

    https://oeis.org, 2022.

2010 Mathematics Subject Classification: Primary 11A41; Secondary 11N05. Keywords: factorial prime, Euclidean prime, primorial prime, Fortunate number, Stirling formula, Gauss prime number theorem.

(Concerned with sequences \underline{A005235}, \underline{A033932}, \underline{A035346}, \underline{A037151}, \underline{A037153}, \underline{A037155}, \underline{A046066}, \underline{A055211}, \underline{A087421}, \underline{A098166}, and \underline{A098168}.)

Received November 11 2021; revised version received January 3 2022; January 10 2022. Published in Journal of Integer Sequences, January 10 2022.

Return to Journal of Integer Sequences home page.