## 1. Introduction: The Bingo Bag of Primes

This work aims to investigate two main objectives: what random means in the case of the distribution of prime numbers and the general conditions ensuring that what we know as

Prime Number Theorem and

Riemann Hypothesis also hold in the case of a generic random sequence of natural numbers. To achieve these goals, we will make use of models based on combinatorics and probability theory. Of course, this is not the first time that models are used to derive new conjectures and theorems about the prime sequence. In the mid-1930s, Cramér [

1,

2] proposed the first stochastic model of the sequence of primes as a way to formulate conjectures about their distribution. This model can be briefly summarized as follows.

Denote by

$\{{X}_{n},n=1,2,3\cdots \}$ a sequence of independent random variables

${X}_{n}$, taking values

0 and

1 according to

(the probability may be arbitrarily chosen for

$n=1,2$). Then, the random sequence of natural numbers

is a stochastic model of the sequence of primes. This means that if

$\mathsf{\Omega}=\{\omega \}$ is the set of all possible sequences

$\omega $ realizations of

S, then the prime sequence, say

${\omega}_{P}$, is obviously an element of

$\mathsf{\Omega}$. We can therefore study the properties of the particular sequence

${\omega}_{P}$, through the methods of probability theory applied to the sample space

$\mathsf{\Omega}$, and conjecture with Cramér that if a certain property holds in

$\mathsf{\Omega}$ with probability 1 (

w.p. 1 in that follows), that is for

almost all the sequences, the same property holds for the prime sequence

${\omega}_{P}$. Obviously, the results of these conjectures lay heavily on the assumption about the probability of the event

$\{{X}_{n}=1\}$, which connects the model with the distribution of prime numbers as stated by the

Prime Number Theorem (

PNT)

with

$\pi (x)$ being the prime-counting function. We see from (

1) that

$\frac{1}{ln(n)}$ can be interpreted as the expected density of primes around

n, or the probability that a given integer

n should be a prime.

As reported by Granville [

3] in his review article dedicated to the work of Cramér in this area, he imagined building the set of random sequences

S through a game of chance consisting of a series of repeated draws (independent trials) from an ordered sequence of urns (

${U}_{1},{U}_{2},{U}_{3},\cdots $) such that the

n-th urn contains

$ln(n)$ black balls and 1 white ball, starting from

$n=3$ forward. In this game, the event

$\{{X}_{n}=1\}$ is then realized by drawing the white ball from the urn number

n.

The heuristic method based on Cramér’s model has been playing an essential role since the mid-1930s to the present day when formulating conjectures concerning primes. The first serious difference between the prediction of the model and the actual behavior of the distribution of primes, was found in 1985 [

4]. As pointed out in [

3], this difference arises because of the assumptions made by heuristic procedures based on the probabilistic model: the hypothesis, when applying the ’Sieve of Eratosthenes’, that sieving by the different primes

$\le \sqrt{n}$ are independent events and Gauss’s conjecture about the density of primes around

n.

The problem was known well before Cramér’s work. In their 1923 paper [

5], Hardy and Littlewood, while discussing some asymptotic formulas of Sylvester and Brun containing erroneous constant factors and functions of the number

${e}^{-\gamma}$ (

$\gamma $ is the Euler–Mascheroni constant), observe that “

any formula in the theory of primes, deduced from considerations of probability, is likely to be erroneous just in this way”. They explain this error arises because of the different answers to the question about the chance that a large number

n should be prime. Following

$PNT$ and Gauss’s conjecture, this chance is approximately

$1/ln(n)$, while if we consider the chance

n should not be divisible by any prime

$\le \sqrt{n}$, assuming independent events for any prime (Hardy and Littlewood do not mention this condition, but it is implicit), this chance is asymptotically equivalent to

Hence, they conclude that any inference based on the previous formula is “

incorrect to the extent of a factor $2{e}^{-\gamma}=1.123\cdots $”. More recently, new contradictions have been found, between the predictions of the model and the actual distribution of primes, that no Cramér-type model, assuming the hypothesis of independent random variables, can overcome [

6].

Cramer’s model founds its connection with the distribution of prime numbers on Gauss’s conjecture; hence, it assumes the

Prime Number Theorem as a priori hypothesis. In this work, a new model is proposed based on a class of combinatorial objects I call

First Occurrence Sequences (

FOS), reproducing the stochastic structure of the prime sequence as a result of the straightforward random structure of the model, based on a sequence of independent equally probable trials. The

Prime Number Theorem emerges, though without any a priori ad hoc assumption about the probability of events. Perhaps the best way to summarize the aim of this work is that it tries to answer the question Granville cites at the beginning of his paper [

3]:

“It is evident that the primes are randomly distributed but, unfortunately, we do not know what ‘random’ means” (the quote is of Prof. R. C. Vaughan).

Following Cramér’s method, we can describe the pinpoints of our model as a game of chance. Suppose we have an urn with $n=2$ balls of different colors, say black (B), and white (W), and let us consider the following sampling with replacement game: choose a ball, say B and replace it; repeat drawing until the white ball W occurs for the first time. In general, the game ends when you draw the ball with a color other than the first ball drawn. The sequences of B and W balls we get from this game are FOS of different lengths k. Some examples:

$BBW$, $k=3$;

$BW$, $k=2$;

$WWWB$, $k=4$;

$WB$, $k=2$.

Assuming each ball has the same probability of being drawn, it is easy to see the average numbers of steps we need to get both colors for the first time, or the average length of

FOS, when

$n=2$, is equal to 3. If we repeat this simple game with different values of

n (number of colors) and the rule that the game ends when all colors appear in the sequence for the first time and compare the average length of

FOS of order

n (say

${L}_{n/n}^{\prime}$) with the prime number

${p}_{n}$ of the same order, we would find the results reported in

Table 1 for

$n=2,3,4,5$, and 6.

The correlation between

FOS average lengths and the sequence of primes is a general property of the model. Indeed, assuming each colored ball has the same probability of being drawn, and every sampling step with replacement is independent of each other, we can easily find

The above equation shows the close connection existing between the combinatorial objects I have called FOS and the primes. In particular, the average length of the n order FOS, obtained through the sampling with replacement game from an urn with n colored balls, is asymptotic to the expression of the n-th prime obtained as a consequence of PNT. In this sense, the n-th order FOS can be defined as the combinatorial counterpart of the n-th prime number.

The following sections are devoted to developing the theory of FOS and their analogies with the distribution of primes. Despite their simplicity, FOS may serve as a general model of random integer sequences which can be applied in different contexts, from combinatorics to physical models (I give a brief hint about this in the last section), showing the common features to all these fields, such as what is known as PNT. The method I followed in this work is to give a complete account of these combinatorial objects independently from the definition of other similar objects, starting from proper probability spaces and the general (recursive) probability relations, then to develop the full theory with particular attention to showing the connections with other research fields. A generalization is proposed in the last part of the work, starting from a continuous version of the original model.

In

Section 2, a formal definition of this kind of objects is given together with the probability spaces we need to define probability relations and probability recursive formulas. In

Section 3, the combinatorics of

FOS is completely solved, demonstrating its close connections with set partitions and Stirling numbers of the second kind. In

Section 4, the probability equations derived from the combinatorial analysis lead to new identities for Stirling numbers of the second kind and for harmonic numbers. The combinatorial model of primes based on

FOS is defined together with a discrete estimate

$\widehat{\pi}(x)$ of the prime-counting function

$\pi (x)$, which is studied and numerically tested. We prove

PNT holds for this model while the

Riemann Hypothesis does not. In

Section 5, the model is generalized to investigate the conditions enabling both

PNT and the

Riemann Hypothesis. We find a general model of random sequences for which the

Riemann Hypothesis holds

w.p. 1 and apply this model to the problem of counting consecutive prime pairs as a function of the gap between successive primes. The theoretical results obtained from the model agree with the empirical data for large gaps and show the importance of the correlation between primes in the case of small gaps. Finally, this model is directly related to the sequence of primes, leading to new integral lower and upper bounds of the prime-counting function

$\pi (x)$. At last,

Section 6 summarizes this work’s general significance and hints at its links with other research areas, particularly with research on physical models.

## 3. Combinatorics of FOS

In the previous section, we have obtained the probability of

FOS through the general recursive Formula (

25) and through closed-form solutions only in a few special cases. The aim of this section is the development of a combinatorial theory of

FOS in order to investigate their connections with other topics of combinatorics, such as set partitions and Stirling numbers of the second kind (Ch. 9, [

9]), then to derive the closed-form probability functions in the next section.

The following simple equation relates the cardinality of the sets

${\mathcal{S}}_{i/n}(k)$ and

${\mathcal{S}}_{i/n}^{\prime}(k)$ defined in Definition 2 and 3

The combinatorics of objects such as sequences

${\omega}_{i/n}(k)\in {\mathcal{S}}_{i/n}(k)$ is well known and treated within the more general problem of counting functions between two finite sets in enumerative combinatorics (1.9 p. 71, [

10]), with applications to set partitions, words, and random allocation (II.3 p. 106, [

11]). The problem of finding

$\#{\mathcal{S}}_{i/n}(k)$ is the same as finding the number of words (or sequences) of length

k, over an alphabet of cardinality

n, containing

i letters (or symbols). As reported in (Equation (

5), [

12]), the total number

${n}^{k}$ of possible sequences can be obtained through the following sum, involving the Stirling numbers of the second kind

$S(k,i)$ (see equation (1.96) p. 75 for details, [

10]). (I keep here the same symbol with two different spellings,

$\mathcal{S}$ and

S, both to denote the set of events (sequences) and the Stirling numbers of the second kind. The meaning is always clear from the context, in any case when

$\mathcal{S}$ denotes a set, it is always followed by a subscript. The adoption of the same symbol is justified by the close connection existing between the cardinality of the set of sequences and the Stirling numbers of the second kind.)

The above equation decomposes the total number of sequences as the sum over

i of the number of such sequences that contain exactly

i distinct symbols. The same identity, obtained through classical algebraic methods, is reported in (Equation (

29), [

13])). On the other hand, remembering Remark 6, we can also write

hence, by comparing (

28) and (

29), it follows

The same solution is found in II.6 p. 113 [

11] under the hypothesis of random allocation of symbols, which is the same as Assumption 1. From (

30) and (

27), we can finally also derive an explicit expression for the cardinality of

FOS.

In the rest of this section, we prefer to present an alternative procedure that allows us to derive the number of FOS sequences directly in order both to find new identities involving the Stirling numbers of the second kind and to show a new combinatorial meaning of these numbers, strictly related to the sequence of primes, which is the main focus of this paper.

#### 3.1. Ordered FOS

Remembering Definition 1 and Remark 3, let us introduce a new kind of combinatorial object.

**Definition** **5.** Let${O}_{i}$be an ordered subset of i distinct elements from${\mathcal{A}}_{n}$, we denote with${\mathcal{S}}_{i/n}^{\prime}(k/{O}_{i})$, k-length ordered First Occurrence Sequences (oFOS) with$i/n$distinct symbols on the ordered choice${O}_{i}$,$(1\le i\le n$,$k\ge i)$, the eventswhere${\omega}_{i/n}^{\prime}(k/{O}_{i})$is an elementary FOS outcome having${O}_{i}$as i-distinct ordered choice, replicating the order of the first occurrence of its distinct i symbols. The following example can help to clarify the above definition.

**Example** **1.** Suppose$n=4$,$i=3$and$k=4$, with${\mathcal{A}}_{4}=\{1,2,3,4\}$,${O}_{3}=\{3,1,4\}$; then the event${\mathcal{S}}_{3/4}^{\prime}(4/{O}_{3})$is made up of the following elementary outcomes: **Remark** **8.** The cardinality of oFOS events depends on parameters i and k only, not on the particular choice of symbols in the ordered set ${O}_{i}$.

The following theorem establishes the relation between FOS and oFOS.

**Theorem** **2.** The cardinality of the set of FOS

${\mathcal{S}}_{i/n}^{\prime}(k)$ is given by ($1\le i\le n$, $k\ge i$):where $g(k,i)$ is the number of k-length oFOS

on an ordered subset of i symbols ${O}_{i}$ **Proof.** Given the ordered choice of symbols

${O}_{i}=\{{a}_{{j}_{1}},{a}_{{j}_{2}},\cdots ,{a}_{{j}_{i}}\}$, any finite subset of

i indices

subject to the constraints

defines a finite-dimensional cylinder set on

${O}_{i}$
through the following assignments:

Therefore, the

oFOS event is equal to

and the

FOS event

As far as the cardinality of the sets from the above equation we get

Since

with

$\mathcal{C}(n,i)$i-combinations of

n elements, and

$\mathcal{P}(i)$ number of permutations of

i elements, Equation (

31) follows. □

#### 3.2. Counting Ordered FOS

The problem of finding the number of

FOS is thus reduced to that of finding the numbers

$g(k,i)$. When

$i=1$,

$k\ge i$ we immediately get

when

$i=2$, it is

Indeed, for

$i=2$, there is only one

oFOS, whatever the value of

$k\ge 2$. Note that (

33) is a particular case of the general property

The calculations are more complex when $i\ge 3$.

**Example** **3.** $i=3$,${O}_{3}=\{1,2,3\}$, through elementary enumerative combinatorics we find **Example** **4.** $i=4$,${O}_{4}=\{1,2,3,4\}$, through elementary enumerative combinatorics we find I will give, in the following, some results about the calculations of $g(k,i)$ numbers, starting with the next lemma that states a recursive formula.

**Lemma** **2.** The number of k-length$oFOS$on an ordered subset${O}_{i}$, as function of the cardinality on an ordered subset${O}_{i-1}$, isstarting with$g(k,1)$,$k\ge 1$, given by (33). **Proof.** Equation (

36) follows directly from Definition 5 and Remark 8, considering that from any

j-length

oFOS on an ordered set

${O}_{i-1}$$(i-1\le j\le k-1)$, one can obtain

${(i-1)}^{k-j-1}$k-length

oFOS on an ordered set

${O}_{i}$ having the

i-th symbol in the last position

k of the sequence.

Note that this lemma holds independently from Assumption 1 of equally probable symbols. □

The result reported below is simply the sum of the first k terms of a geometric series and will be referred to by the next theorem.

**Lemma** **3.** Given q real,$\left|q\right|<1$, then **Theorem** **3.** Let$g(k,i)$be the number of k-length oFOS on an ordered set of i distinct elements. Then the following statements hold:with coefficients${a}_{i,j}$defined recursively asstarting with **Proof.** Let us proceed by induction. Equation (

37) holds for

$i=3$, indeed from Lemma 2 remembering (

34) we get

and, hence, from Lemma 3

Let us now prove that if (

37) is true for

i,

$i\ge 3$, then it is true for

$(i+1)$. Substituting (

37) in (

36) for

$g(k,i+1)$ we get

from which, after some manipulations, one gets

The single sum

after the application of Lemma 3

and some manipulations, can be written as

Finally we can write

hence

with

${a}_{i+1,j}$ given by (

38),

$j=1,2,\cdots ,i-2$,

${a}_{i+1,i-1}$ given by (

39). □

The last theorem gives us a method to calculate each coefficient of the row $i+1$ from the coefficients of the previous row i. The following corollary state an alternative way to calculate the last term of each row, as function of the other coefficients of the same row.

**Proof.** The result follows directly from (

35) and (

37):

Hence, remembering (

38) and (

39), after some manipulations, one gets (

40). □

The first rows of coefficients

${a}_{i,j}$ are reported in

Table 2.

Theorem 3 and the subsequent corollary state a method of calculating coefficients ${a}_{i,j}$ by rows. The next proposition establishes another way to find them, proceeding by columns.

**Corollary** **4.** Given the coefficient${a}_{j+2,j}$, head of column j, the successive coefficients in the same column can be calculated as The column head coefficients can be calculated as a function of the previous ones only, through the following formulastarting with **Proof.** Equation (

41) is derived simply through a recursive application of Equation (

38), from the row index

$j+3$ to the required row index

i.

By substituting (

41) into (

39), we obtain the second Equation (

42). □

The next theorem states a general non-recursive formula to get the coefficients ${a}_{i,j}$ directly as a function of the indices $i,j$.

**Theorem** **4.** The following equation holds for each coefficient${a}_{i,j}$ **Proof.** First of all, let us prove by induction, the formula holds in the case of column head coefficients. In this case, using the notation of Corollary 4, Equation (

43) becomes

The above equation is true for

$l=1$, since we know it is

${a}_{3,1}=1$. Assuming it is true for

$l=1,2,\cdots ,j$, from (

42) we get the identity

where the term on the left-hand side of the equation is the value of

${a}_{j+2,j}$ calculated through (

42), the one on the right-hand side is the value of the same coefficient given by (

44). Then, the same identity holds for the next head of column coefficient

${a}_{j+3,j+1}$; indeed Equation (

42) leads to the result

The proof of (

43) in the case of non-head of column coefficients follows simply from (

41) after assuming (

44). □

The identity (

45) deserves some more attention: it expresses the normalization property of the

FOS probabilities

${\sum}_{j=n}^{\infty}{\varphi}_{n/n}^{\prime}(j)=1$ (see forward Equation (

76) and Remark 10). After some simple manipulations, it can be written as

that appears to be “complementary” of the well-known identity (see Equation (1.13), [

14])

#### 3.3. Ordered FOS and Stirling Numbers of the Second Kind

The solution we have found about the number of elementary sequences of the event

${\mathcal{S}}_{i/n}^{\prime}(k/{O}_{i})$, presented in Definition 5 as

oFOS of length

k with

i distinct symbols on the ordered choice

${O}_{i}$, allows us to show the equivalence of

$g(k,i)$ numbers and Stirling numbers of the second kind. Indeed, from Equation (

37) of Theorem 3, it follows

and remembering (

39) of the same theorem

Substituting in the above equation

${a}_{i,j}$ and

${a}_{i+1,i-1}$ as given by (

43) and (

44) of Theorem 4, we get

Since

we finally arrive at

The right-hand side of the previous equation is the explicit formula for the Stirling number of the second kind

$S(k-1,i-1)$ (see Equation (9.21), [

9]). The equivalence can be extended to values

$i=1$ and

$i=2$, since from Equation (

34) for

$i=2$ it follows

and for

$i=1$ from (

33)

Note that the last equation solves the “bit tricky” case of the Stirling number

$S(0,0)$ (p. 258, [

15]), by calculating it instead of assuming it “by convention” (this assumption is common to all the treatments of the subject, see for example (p. 73, [

10])). We have thus proved

**Theorem** **5.** Given$g(k,i)$, the cardinality of the oFOS set${\mathcal{S}}_{i/n}^{\prime}(k/{O}_{i})$defined in Definition 5, and the Stirling number of the second kind$S(k-1,i-1)$, the following equation holds true: **Remark** **9.** Due to the equivalence established by the previous theorem, Equation (36) of Lemma 2 can be rewritten asthat can be obtained through the repeated application of the recursive equation of the Stirling numbers of the second kind (see Equation (9.1), [9]) When

$k=i$ we know it is (see Equation (

35))

$g(i,i)=1$ and, hence, from the general Formula (

49) we get

or

which is the identity (

47) mentioned above. This identity is thus closely related to the Stirling numbers and to the general property

$g(i,i)=S(i-1,i-1)=1$,

$i\ge 1$ (see Equation (

4) and [

13] and references therein). Note that by substituting (

31) with

$g(k+1,i+1)$ given by (

50), into Equation (

27) we obtain for

$\#{\mathcal{S}}_{i/n}(k)$ the same Equation (

30).

We know Stirling numbers of the second kind have a combinatorial meaning directly related to the problem of partitioning a set into a fixed number of subsets,

$S(n,m)$, counting the number of ways a set of

n elements can be partitioned into

m nonempty disjoint subsets (Ch. 9, p. 113, [

9], Ch. 1.9, p. 73, [

10], and see also [

15] for a complete combinatorial treatment of the Stirling numbers). The analysis performed in this section highlights an alternative combinatorial interpretation of these numbers, together with the close connection of

oFOS with set partitions, that will be shown to be strictly related to the sequence of primes in the next section.

## 4. First Occurrence Sequences, Set Partitions, and the Sequence of Primes

In this section, we will delve into FOS sequences as a model of the distribution of prime numbers. The simple oFOS sequences can already act as a first-level model of the prime number distribution, as we will see in the next subsection, while the complete model based on FOS will be developed at the end of this section. In order to develop the tools to build this model, we continue in the following to deepen the combinatorial implications of Theorem 5, exploring some interesting identities involving Stirling numbers of the second kind and harmonic numbers, derived through the probabilities of FOS.

#### 4.1. Ordered FOS and the Prime Number Theorem

The equivalence (

50) stated by Theorem 5 and the combinatorial meaning associated with

S and

g numbers suggest the following analogy with the distribution of primes. Given any integer set of the type

there exists a sequence of

$(n+1)$ successive primes

such that the prime-counting function

$\pi (k)=n$. The set

${O}_{n+1}$ can be viewed as an ordered choice of

$n+1$ integers and the set

${I}_{k+1}$ as an

oFOS over

${O}_{n+1}$ (remember Definition 5). Note that the integers

i between two consecutive primes,

${p}_{j}<i<{p}_{j+1}$, are multiples of the primes from

${p}_{1}$ to

${p}_{j}$, hence they can be considered as repetitions of these symbols, thus confirming the

oFOS schema. In the light of this analogy, some classical results of the theory of random partitions of finite sets can be reinterpreted as a general form of the

Prime Number Theorem, which holds for all

oFOS-like sequences.

The

oFOS model of the distribution of prime numbers can be defined as follows. Let us consider the number of primes less than or equal to

k, represented by the prime-counting function

$\pi (k)$, as a random variable

${\pi}_{o}(k)$ with probability mass function defined by

and, hence, from Theorem 5

Equation (

53) defines a uniform probability distribution on the class

${\mathsf{\Pi}}_{k}$ of partitions of a set of

k elements, obtained by assigning the same probability

${B}_{k}^{-1}$ to each partition

$\sigma \in {\mathsf{\Pi}}_{k}$,

where the total number of partitions

${B}_{k}$ is equal to the

k-th Bell number defined as (9.4, p. 133, [

9])

The combinatorics of

${\mathsf{\Pi}}_{k}$ is studied in [

16,

17] (see also Ch. IX, p. 692 [

11], for a brief summary of these results) in connection with the asymptotic (

$k\to \infty $) distribution of the probability measure

${P}_{k}$ (Harper points out the methods used are based on the combinatorial implications of probability theory and ascribed to W. Feller (see Ch. X, p. 256 [

18]), and V. Goncharov (see [

16] and references therein), the first applications in this field). From this approach, it follows that the random variable

${\pi}_{o}(k)$ with uniform probability (

53), defined as a model of

$\pi (k)$, has mathematical expectation and variance asymptotically equal to (see Ch. 4, pp. 114–115 [

19])

where

$r=W(k)$, the unique positive solution of

$r{e}^{r}=k$,

$W(x)$ being the Lambert function [

20] defined in the domain

$x\ge -1/e$. Since for the function

$W(k)$, we know it is

$r\sim lnk$ as

$k\to \infty $, the above equations say the average and variance of the random variable

${\pi}_{o}(k)$ are asymptotic to

Equation (

55), and the related variance (

56), represents the form assumed by

PNT when considering

oFOS-like sequences with uniform probability distribution of set partitions. This is not the only admissible distribution. About this problem and the general conditions in order that a uniform distribution is obtained, through random allocation algorithms (or random urn models), see [

21] and the references therein. The following result (see Theorem 1.1, p. 115, [

19]) completes the application of the methods derived from the theory of random partitions of sets, to the

oFOS model of the prime number distribution. The probability distribution of the normalized random variable

converges to that of the standard normal distribution as

$k\to \infty $, that is:

#### 4.2. FOS Probabilities and Some Combinatorial Identities Involving Stirling Numbers

Let us collect, in this subsection, some formulas about the probability function

${\varphi}_{i/n}^{\prime}(k)$, which will be referred to in the rest of this paper. Under Assumption 1, from Equation (

31) of Theorem 2 the probability of

FOS is given by

By substituting

$g(k,i)$ with Equations (

37) and (

39) of Theorem 3, we get the following expressions for

$3\le i\le n$,

$k\ge i$Finally, from (

43) of Theorem 4 the explicit expression for

${\varphi}_{i/n}^{\prime}(k)$ follows

If we set

$l=i-j-1$, the above equation can be written

When

$i=n$ (

$n\ge 2$,

$k\ge n$), Equation (

60) becomes (it is easy to check this equation, and (

64) below, which also applies to the case

$n=2$)

which, observing that

can be written as

Equation (

61) when

$i=n$ (

$n\ge 2$,

$k\ge n$), becomes

which, observing that

can be written as

Let us now derive the sequence probabilities expressed through the Stirling numbers of the second kind. Remembering the equivalence (

50), Equation (

57) can be written as

From this equation and (

27), always under the hypothesis of equally probable symbols, hence (

19), (

20), it is easy to get

The above equations, combined with the general properties of the probability functions (

11)–(

18), give rise to a series of combinatorial identities involving the Stirling numbers of the second kind. The following corollary reports the less trivial ones.

**Corollary** **5.** The following identities hold true.

Note that identity (

68) is the same as (

28) and identities (

68), (

71) imply (

70).

I report in the following two more results about the sum of probabilities

${\varphi}_{n/n}^{\prime}(k)$, that clarify the probabilistic meaning of identity (

46) and the close connection between these probabilities and the Stirling numbers of the second kind.

**Corollary** **6.** The following equations hold true **Proof** **of** **Equation** **(73).** By applying Lemma 3

hence

Since we know that

${\sum}_{s=n}^{\infty}{\varphi}_{n/n}^{\prime}(s)=1$ and

it is

Finally from (

75) and (

76), Equation (

73) follows. □

**Proof** **of** **Equation** **(74).** Remembering (

66) we can write

and, hence, through identity (

70), we simply get (

74). □

**Remark** **10.** Note that Equation (76) above is the same as (45), (46). Indeed, after some manipulations, it can be written as This identity thus has a probabilistic meaning connected with the normalization property of FOS probabilities.

**Remark** **11.** We know (Equation (26.8.42), [22]) the Stirling number of the second kind, for fixed value of n, as$k\to \infty $is asymptotic to This asymptotic behavior follows very simply from Equation (74) due to the connection established between FOS probabilities and$S(k,n)$. #### 4.3. Bounds of $g(k,i)$ Numbers and Stirling Numbers of the Second Kind

We speak of $g(k,i)$ numbers since the results are directly related to their formulation through the coefficients ${a}_{i,j}$, as stated by Theorem 3. The results are obviously applicable to the Stirling numbers of the second kind.

**Definition** **6.** Let us define for$i\ge 3$,$1\le j\le (i-2)$andwhere the sign of$|{a}_{i,1}|$is negative if j is an even number, positive if it is an odd number. **Lemma** **4.** The following statements hold true: **Proof.** Equation (

77) follows simply from the values of the coefficients given by (

44).

Equation (

39) of Theorem 3 gives

from that and (

77), Equation (

78) follows.

Considering Definition 6, from (

39) we can write

with

${a}_{i+1,i-1}>0$, hence (

79).

From Equation (

44) it is easy to prove that

hence the previous equation also implies (

80).

(

80) implies both (

81) and (

82). □

**Lemma** **5.** Given${\sigma}_{i,j}$and${\tau}_{i,j}(k)$of Definition 6, it is **Proof.** Suppose

j even, then we can write

By adding the pairs of the previous inequality, we obtain the thesis.

In the case when j is odd, we can repeat the above procedure considering the pairs for $s=3,5,7,\cdots ,j$, then adding up these pairs and the last term $|{a}_{i,1}|$ taken with a positive sign. □

**Theorem** **6.** Given the numbers$g(k,i)$,$i\ge 3,k\ge i$, the following bounds holdand, for i fixed **Proof.** From the Definition 6 we can write in general

and, remembering (

48),

The thesis (

83) follows from Lemma 5 and (

80), (

81) of Lemma 4.

The inequalities (

83) can be rewritten as

from which Equation (

84) follows. □

**Remark** **12.** The closed-form (44) of coefficients allows us to rewrite (83) and (84) as When speaking of Stirling numbers of the second kind, the previous bounds become Note that (87) gives an alternative proof of the asymptotic behavior of $S(k,i)$ for fixed i (see Remark 11). **Remark** **13.** Assuming the left-hand side of the above inequality is positive both for$S(k,i)$and$S(k-1,i-1)$, that iswe get the bounds of the ratiothat for$i\gg 1$becomesunder condition #### 4.4. FOS Average Length and Harmonic Numbers

As anticipated in the Introduction, calculating the average length of

FOS sequences, that is, of elementary events

${\omega}_{i/n}^{\prime}(k)$,

$k\ge i$ of the countable space

${\mathsf{\Omega}}_{i/n}^{\prime}$, is a simple task leading to the result (

2) in the case

$i=n$. This calculation is based on the following well-known results, in particular on Lemma 7, expressing the average number of trials one has to wait before obtaining the first success in a sequence of independent Bernoulli trials with

p probability of success.

**Lemma** **6.** Given q real,$\left|q\right|<1$, then **Lemma** **7.** Given p real,$0<p\le 1$, then Therefore, if we denote, in general, the quantity we are looking for with

${L}_{i/n}^{\prime}$, we can establish the following recursive relation

starting with

It is easy to see the above equation leads to

where

${H}_{n}$ is the

n-th harmonic number

and

If we consider the set of discrete random variables

${q}_{i/n}$ with probability mass function

then the quantity

${L}_{i/n}^{\prime}$ can be also obtained as the mathematical expectation of the corresponding random variable

${q}_{i/n}$, hence through

From (

91) and (

90), remembering (

66), we get the following relation between harmonic numbers and Stirling numbers of the second kind.

Other combinatorial identities involving harmonic numbers and finite term series can be derived from the direct calculation of (

91) as established by the following proposition. (These identities appear to be new, such as the method of deriving them. Of course, it is not simple to establish the novelty of an identity involving harmonic numbers because of the historical interest of this subject and the great development of theory and applications. For an extensive collection of these identities, see [

23,

24,

25] and the references therein.)

**Theorem** **7.** Assuming n and i positive integers,$n\ge 3$and$3\le i\le n$, the following identity holds truewhere${a}_{i,j}$are the coefficients defined by Theorem 3. **Proof.** By substituting in (

91) the term

${\varphi}_{i/n}^{\prime}(k)$ as given by (

58), we get

from which it follows

We can write

and remembering Lemma 6 and the sum of geometric series

In a similar way, the second term becomes

Inserting the previous formulas into (

94), we get

from which and Equations (

39), (

90), and (

93) follow. □

The following corollary is a simple application of the formulas of Theorem 4 to that of the previous theorem.

**Corollary** **8.** For n and i positive integers,$n\ge 3$and$3\le i\le n$, the following identity holds true When$i=n$we get for the n-th harmonic number #### 4.5. FOS as a Model of the Distribution of Primes

This subsection aims to analyze analogies and limits of FOS with respect to the true sequence of prime numbers. There is a correspondence between prime numbers and FOS as stated by the following remark.

**Remark** **14.** Given any prime${p}_{n}$,$n\ge 2$, there exists an event FOS

(see Remark 7), and the whole sequence of prime numbers corresponds to the elementof the product setwe can define as FOS

universe. The model based on FOS takes then into consideration the set ${\mathsf{\Omega}}_{n/n}^{\prime}$ as the combinatorial counterpart of the n-th prime ${p}_{n}$, considered as a discrete random variable assuming integer values between n and ∞. The statistics of this random variable are then used to define a “counting variable”, which is the FOS model equivalent of the prime-counting function. In order to avoid any confusion when dealing with our model, we keep the symbol ${p}_{n}$ to denote the “true” value of the n-th prime, and adopt the symbol ${q}_{n}$ for the random variable modeling it. The basic assumption of the model is the following.

**Definition** **7.** The discrete random variable${q}_{n}$has probability mass functionwith${\varphi}_{n/n}^{\prime}(k)$, defined in Equation (20). The results of the model are referred to the sequence of random variables $\{{q}_{n}\}$ and confronted with the analytical or numerical results we know about the true prime sequence $\{{p}_{n}\}$. These results, some of which are reported in two sample tables, justify a posteriori the model’s adoption and the not completely rigorous approach we follow in deriving it.

From (

66) and (

90) respectively we get the probability

and the mean value of

${q}_{n}$Hence, given

$k\ge n$,

k integer, the probability distribution function of

${q}_{n}$
with

is simply expressed through the number of ways a set of

k elements can be partitioned into

n disjoint nonempty subsets

where the last equation follows from (

74).

Let us define the discrete random variable ${\xi}_{k}$ whose probability distribution is induced by ${q}_{n}$ through the following

In our combinatorial model, ${\xi}_{k}$ is associated with the value $\pi (k)$ of the prime-counting function, considered as a random variable assuming integer values between 1 and k.

**Theorem** **8.** The discrete random variable${\xi}_{k}$with probability distribution (99) assumes values between 1 and k, has probability mass functionand mathematical expectation **Proof.** From (

98), due to the properties of

$S(k,n)$ numbers, we get for

$n=1$
for

$n=k$
for

$n>k$This proves the first statement.

Given

n and

m positive integers with

$n<m$, from (

100) we get

From this relation, assuming

$m=n+1$ the probability mass function (

101) follows.

The mathematical expectation of

${\xi}_{k}$ is given by

that is the same as Equation (

102) since

${\mathsf{\Phi}}_{k+1}(k)=0$. □

**Remark** **15.** The mean value of the discrete random variable${\xi}_{k}$is equal to The previous theorem suggests to assume

$E\left[{\xi}_{k}\right]$ as an estimate

$\widehat{\pi}(k)$ derived from the combinatorial model of the prime-counting function

$\pi (k)$, that is, remembering the equality (

98)

An alternative expression for

$\widehat{\pi}(k)$ can be derived from Remark 15 and Equation (

73)

To check the quality of the function

$\widehat{\pi}(k)$ as a numerical estimate of

$\pi (k)$, Equation (

104) looks more suitable since it can be written in a recursive form. Indeed, if we put

with

from the recursive equation of the Stirling numbers of the second kind (

51), we get the following recurrence for the terms

$w(k,n)$
initialized as

Table 3 reports a series of values of the recursive estimate

$\widehat{\pi}(k)$, compared with the prime-counting function

$\pi (k)$ and the logarithmic integral function

$li(k)$. The last column of the table reports the values obtained through continuous approximation formulas I will expose hereafter.

In order to analyze the asymptotic behavior of

$\widehat{\pi}(k)$, we look for a continuous approximation of the probability function

${\mathsf{\Phi}}_{n}(k)$. After promoting

k and

n to be continuous variables, which is a justifiable assumption for

$k\gg 1$ and considering the relation (

98) between

$\mathsf{\Phi}$ and

S, Equation (

97) is written as

Taking the derivative of the above equation, we get the differential equation for

$\mathsf{\Phi}$
that can be written as

We set

where

${\lambda}_{n}(k)$ is a parameter function depending on

n and

k. Then the general solution of the differential equation is

and the value of the constant is

C is determined by the asymptotic condition

${\mathsf{\Phi}}_{n}(k\to \infty )=1$.

**Remark** **16.** It is interesting to note the method, based on probabilistic arguments, that led to Equation (107), provides an alternative approach to the problem of exploring the asymptotics ($k\to \infty $) of Stirling numbers of the second kind. Since this topic is outside the scope of this work, I cite only the following example. If we choosethen it isand from (98), we get the well known asymptotic approximation of$S(k,n)$(see [26] and references therein)which is valid in the region$n<\frac{k}{lnk}$, coinciding asymptotically with the region of validity of (88),$nlnn<k$. As a continuous approximation of the probability function

${\mathsf{\Phi}}_{n}(k)$ we are looking for, let us choose a parameter function depending on

n only through the following simple relation

where the constant

a varies between 1 and

e as suggested by the boundary conditions of the Stirling number ratio. Indeed for

$n=k$ the ratio (

106) is

that implies

${\lambda}_{n}=en$, while for

$k\gg n$, we know it is

hence

${\lambda}_{n}=n$.

Therefore (

107) becomes

and from (

102) and (

104), we get the continuous approximation of

$\widehat{\pi}(k)$The last column of

Table 3 reports some examples from this approximation formula with

$a=(1+e)/2$.

Table 4 reports the values calculated through (

109) with

$a=e$ compared with the values of

$\pi (k)$ up to

$k={10}^{27}$ (data with

$\pi (k)$ values are taken from N. J. A. Sloane, ‘The On-Line Encyclopedia of Integer Sequences. Sequence A006880’,

http://oeis.org (accessed on 31 March 2021); Wikipedia contributors, ‘Prime-counting function’, Wikipedia, The Free Encyclopedia,

https://en.wikipedia.org/w/index.php?title=Prime-counting_function&oldid=987382574 (accessed on 31 March 2021)).

The following proposition, which is the

FOS equivalent of the

Prime Number Theorem, can be stated for the function

$\widehat{\pi}(k)$ defined by (

109).

**Theorem** **9.** Given$\u03f5>0$, however small, it holdsdefinitively for$k>{k}_{0}$. **Proof.** ${\mathsf{\Phi}}_{n}(k)$,

$n>0$,

$k>0$, is a decreasing function with

n. Indeed,

Given

${n}_{0}$ and

${n}_{1}$ such that

$1<{n}_{0}<{n}_{1}<k$, we can write

and, due to the decreasing of

${\mathsf{\Phi}}_{n}(k)$ with

n,

Given

$\u03f5$,

$0<\u03f5<1$, let

$\frac{1}{\gamma}=1+\frac{\u03f5}{2}$, hence

$\frac{2}{3}<\gamma <1$, and

then the previous inequalities become (note that

${n}_{1}(k)<k$ for

$\frac{1}{\gamma}<lnk$)

The limit for

$k\to \infty $ of the left-hand and the right-hand side of the previous inequality, say

$L(k)$ and

$R(k)$ respectively, gives

that is

and

that is

Let ${k}_{0}=Max\{{k}_{L},{k}_{R}\}$, then for $k>{k}_{0}$ we get the thesis. □

What does the model say about the

Riemann Hypothesis [

27]? We know the most famous

millennium problem (E. Bombieri, “Problems of the Millennium: The Riemann Hypothesis”, Clay Math. Institute. (2000) online at

http://www.claymath.org/sites/default/files/official_problem_description.pdf accessed on 31 March 2021) is equivalent to establish the bound of the prime-counting function

$\pi (x)$ [

28]

with

$M>0$ constant, definitively for

x sufficiently large (

$li(x)$ is the logarithmic integral function defined for

$x>1$ as

$li(x)={\int}_{0}^{x}\frac{dt}{lnt}$, where the integral is to be intended as Cauchy principal value). We can prove that this bound, which I will refer to as the

RH rule throughout this work, occurs

w.p. 0, or better, that the

RH rule does not hold

w.p. 1 for the random variable

${\xi}_{k}$, defined above as the stochastic counterpart of

$\pi (k)$ in our model.

**Theorem** **10.** Let${\xi}_{k}$then random variable with probability distribution (99), then it is **Proof.** Since

it is easy to see that both

${\mathsf{\Phi}}_{n(k)}(k)$ and

${\mathsf{\Phi}}_{m(k)}(k)$From (

103) then it follows

□

Theorems 9 and 10 say what we know as PNT when dealing with primes holds for the counting variable ${\xi}_{k}$ associated with the set of sequences generated through the random sampling with replacement game I proposed in the Introduction, while the Riemann Hypothesis requires compliance with much stricter requirements such that it has zero probability to occur for the same counting variable.

## 5. Model Generalization and the Connection with the Riemann Hypothesis

This section deals with the generalization of the FOS model so that we can discriminate between two classes of models, compliant and not compliant with the RH rule. This allows us to use the different stochastic properties, depending on different models, of the random variables ${q}_{n}$ and ${\xi}_{k}$ to deduce some properties of the whole sequence of primes. In particular, we apply the model to infer the counting of successive prime pairs and then compare the result with actual sequences of prime pairs.

#### 5.1. Model Generalization

In this section, we will consider the random variables

${q}_{n}$ of Definition 7 as a continuous random variable, assuming values in

$[n,\infty )$ according to the following probability distribution function

with

${\mathsf{\Phi}}_{n}(x)$ given by the solution of the differential equation

obtained by considering a more general expression for the ratio (

106), where

n is substituted by

$f(n)$, a positive function of

n.

**Notation.** The probability density function of${q}_{n}$, that is the function${\varphi}_{n/n}^{\prime}(x)$of the FOS

model, will be denoted as follows: Therefore, the probability functions of

${q}_{n}$ become

The constant

C is determined by the normalization condition

hence

The complete expressions of the probability density and distribution function are

Note that

${\varphi}_{n}(x)$ has a single maximum point at

The mathematical expectation of

${q}_{n}$ (this calculation is reported in [

29] for the case

$f(n)=n$) is

where

$\gamma =0.57721\cdots $ is the Euler–Mascheroni constant and

${E}_{1}(x)$ is the exponential integral function with positive real argument

$x>0$, sometimes referred to as upper (or complementary) incomplete gamma function

$\mathsf{\Gamma}(0,x)$, defined by (see functions 5.1.1, 6.5.3, [

30])

We require the mathematical model to satisfy a similar condition to (

95) about the mean of

${q}_{n}$, that leads to the following formula

obtained from (

114), assuming

$n\gg 1$ sufficiently large, so we can neglect the terms

${e}^{-{\lambda}_{n}{e}^{-n/f(n)}}$ and

${E}_{1}({\lambda}_{n}{e}^{-\frac{n}{f(n)}})$. Note that the function

${E}_{1}(x)$ decreases rapidly as

$x\to \infty $, in particular [

31], (1.4)

**Remark** **17.** The FOS combinatorial model studied in Section 4.5 corresponds to the function$f(n)=n$. In this case (115) is satisfied for(in particular when$a={e}^{-\gamma}$it is$E\left[{q}_{n}\right]=nlnn$). We know from Theorem 10 that the RH rule does not hold w.p. 1 for this class of models, which I will refer to as n-Model.

Another class of models of particular interest to our study, as we will see in the following, is the one determined by the choice

$f(n)=lnn$. In this case, condition (

115) can be satisfied using different functions having opposing implications as far as the compliance of the model with the

RH rule. We focus, in particular, on a solution ensuring the

RH rule holds

w.p. 1.

**Remark** **18.** The model with$f(n)=lnn$will be referred to as log(n)-Model.

The simplest

log(

n)

-Model is the one defined by the choice

hence by the parameter value

Through the methods of the previous section, it is possible to prove the same statements as Theorems 9 and 10, that is, this log(n)-Model is compliant with PNT and not with the RH rule.

Let us consider instead the

log(

n)

-Model defined by the assumption

where

$ali:\mathbb{R}\to (1,+\infty )$ is the inverse function of the logarithmic integral function

$li(x)$ (I use for this function the same notation as in [

32]). In this case, we get

and condition (

115) is satisfied since we know it is (Theorem 3.3, [

32])

Equations (

111) and (

112), under the approximation for

$n\gg 1$, become

with

${r}_{n}=ali(n)$.

The double exponential distribution function (

122) is often called Gumbel distribution [

33,

34].

**Remark** **19.** In the case of the model with$f(n)=lnn$, the ratio (106) is equal toit is$o({e}^{-\frac{k}{n}})$as$k\to \infty $and deviates asymptotically from the Stirling number ratio which is$\sim {e}^{-\frac{k}{n}}$. Briefly speaking, the log(n)-Model defined above corresponds to a subset of the FOS universe $\mathcal{U}$ which is different from the one of the n-Model, containing sequences conforming to both PNT and the RH rule, as stated by the following theorems.

The continuous approximation function

$\widehat{\pi}(k)$ becomes

In addition, for this function we can enunciate a proposition, which is the equivalent of the Prime Number Theorem.

**Theorem** **11.** Given$\u03f5>0$however small, there exists${k}_{0}$such that for$k>{k}_{0}$it holdswhere the function$\widehat{\pi}(k)$is defined by (123). The proof is completely analogous to that of Theorem 9.

**Remark** **20.** Associated with the log(n)-Model we can define the counting random variable${\xi}_{k}$as in Definition 8, after assuming the probability distribution (110). It is easy to prove the analog of Theorem 8 for this variable, in particular Equations (101) and (103). We can therefore apply the probability method developed for the n-Model also in the case of the log(n)-Model. The

RH rule holds

w.p. 1 for the

log(

n)

-Model with

$E\left[{q}_{n}\right]$ defined by (

118).

**Lemma** **8.** Let$f(x)=ali(x):\mathbb{R}\to (1,+\infty )$be the inverse function of the logarithmic integral function$li(x)$andits n-th derivative. Then we haveand for$n\ge 2$with **Proof.** Note that the function

$f(x)=ali(x)$ is real analytic. The first derivative follows directly from the definition, since

$li(ali(x))=x$. We proceed by induction. The thesis is true for

$n=2$, indeed

Let us assume it is true for (

$n-1$)

then we have for the

n-th derivative

from which, grouping the terms by powers of

${f}^{(1)}(x)$, the thesis follows. □

**Theorem** **12.** Let${\xi}_{k}$be the random counting variable of Definition 8 with probability distribution (110) associated with the log(n)-Model (118), then it is **Proof.** Let

and

then from (

103) we know it is

with probability distribution functions given by (

122),

Since we know

$ali(x)$ is real analytic, consider its Taylor series

$ali({x}_{0}+h)$ at

from Lemma 8

which can be written

From the asymptotic expansion of

$li(x)$ we get

which leads to the following expression for

$lnn(k)$From (

124) and (

125) we finally get

and the limits for

$k\to \infty $Through analogous calculations for

$m(k)$ we find

and the limits for

$k\to \infty $From (

103) then it follows

□

We can get an estimate of the speed of convergence to 1 of the probability of the RH rule as follows. If we denote with ${\mathcal{U}}^{\prime}\subset \mathcal{U}$ the subset of random sequences of positive integers distributed according to the log(n)-Model with mean $ali(n)$, under the assumption that the sequence of prime numbers $\{{p}_{n},n=1,2,3,\cdots \}$ belongs to the set ${\mathcal{U}}^{\prime}$, we can use the properties of the Gumbel distribution and Chebyshev’s inequality to get the probability of the RH rule, more generally the probability of any difference $|{p}_{n}-ali(n)|$, as a function of n. In other words, we can consider ${\mathcal{U}}^{\prime}$ as a stochastic process $\{{q}_{n},n=1,2,3,\cdots \}$ of random variables differently distributed and the sequence of primes as particular realization of the process.

Different bounds of the difference

have been established for the sequence of prime numbers, depending on the conditions assumed. From ((1.3), [

35]) we know that it holds unconditionally for

while under the

Riemann Hypothesis, we get (Theorem 6.2, [

32])

From the properties of the Gumbel distribution we know the variance of

${q}_{n}$ is (note that the probability distribution (

112) is not exactly a Gumbel distribution because of the cut at

$x=n$ of definition (

110). Assuming

n sufficiently large, so that (

121) and (

122) hold, we can consider the probability distribution of the model as a Gumbel distribution).

hence, from Chebyshev’s inequality (see Chapter IX, p. 233, [

18]), it follows that the probability of the unconditioned bound converges to 1 with a quadratic law

while in the case the

Riemann Hypothesis holds

#### 5.2. Counting Successive Prime Pairs through the log(n)-Model

The general problem of prime pairs can be stated as follows: given d and N positive integers, d even, what is the number ${H}_{N}(d)$ of pairs of primes (not necessarily consecutive), $p,{p}^{\prime}\le N$ such that ${p}^{\prime}=p+d$? Connected with this there is the following one, we can call as the problem of counting successive prime pairs: given d and N positive integers, d even, what’s the number ${h}_{N}(d)$ of pairs of primes ${p}_{i},{p}_{i+1}\le N$, separated by the gap d, that is such that ${p}_{i+1}={p}_{i}+d$?

Mathematics has no certain results about these two problems which are different from the so called “bounded gaps problem”, recently solved by mathematician Yitang Zhang [

36], who proved that as

$i\to \infty $ there are infinitely many prime pairs

${p}_{i+1}-{p}_{i}=d$, with

$d<7.0\times {10}^{7}$. Successively, this bound has been lowered to 246 through the extension of the method of Zhang and other contributors. Nevertheless, the twin primes conjecture which requires the bound to be reduced to

$d=2$, remains unproven. Important results towards this goal can be found in [

37,

38], showing in particular that

${lim\; inf}_{i\to \infty}\frac{d}{ln{p}_{i}}=0$, that is there always be pairs of primes

${p}_{i+1}={p}_{i}+d$ with

d less than any fraction of

$ln{p}_{i}$, the average spacing between successive primes.

In 1923, Hardy and Littlewood proposed the following formula as a solution of the general problem, stressing that it was impossible for them “to offer anything approaching a rigorous proof” (see Conjecture B, [

5]):

where

The product is over all odd primes in (

127), over odd primes dividing

d in (

128). The constant

${C}_{2}=2{c}_{2}=1.32032363\cdots $ is called the twin prime constant, while the term

$J(d)$ is responsible for the irregularities and the oscillating pattern of the counting functions. A formula similar to (

126) for the counting of successive prime pairs separated by a gap

d, was suggested by Wolf ([

39], and the references therein) after enumerating, by means of a computer program, all gaps between consecutive primes up to

$N={2}^{44}\approx 1.76\times {10}^{13}$. Starting from the observed pattern, which showed an exponential decay of the number of pairs depending on

d, at the end of a heuristic procedure including approximations due to

PNT, he deduced the complete formula (the procedure is reported in M. Wolf (2018),

Some Heuristics on the Gaps between Consecutive Primes, available at

https://arxiv.org/abs/1102.0481 accessed on 31 March 2021).

The functional dependence on

N of the formula above can be transformed into a dependence on the sequence number

n of the greatest prime

${p}_{n}$ interested in the count. Indeed, we can set

$N={p}_{n}\sim nlnn$ and

$\pi (N)=n$ and, hence, it is easy to get

and the counting formula becomes

where I changed the capital letter

N to lower case

n so as to remember the different meaning of the functional dependence.

The original Hardy and Littlewood conjecture was empirically tested by several authors and used to calculate the number of pairs

${h}_{N}(d)$ in the case of small gaps

d between successive primes [

40]. I show in the following that the conjecture of Wolf, which is based on a large amount of empirical data, can be derived from the combinatorial model we defined as

log(

n)

-Model in Remark 19.

**Remark** **21.** Note that the conjecture (131) can be written aswhere${F}_{n}(d)$is the function defined in (130) and **Definition** **9.** Given the sequence of primes$\{{p}_{n},n=1,2,3,\cdots \}$, let us define the gap${g}_{n}$between successive primes and the number of successive prime pairs${h}_{n}(d)$separated by a gap d depending on the sequence number n as The gap

${g}_{n}$ can be modeled as the difference between the random variables

with probability mass function

where

${\varphi}_{n,n+1}(x,y)$ is the joint probability density function of the couple

$({q}_{n},{q}_{n+1})$. We can obtain the estimate of the function

${h}_{n}(d)$, as resulting from the combinatorial model adopted, through the equation

We do the following assumption.

**Assumption** **2.** (Large gaps independence law) For$d\gg 2$sufficiently large, the two events${q}_{n}=x$and${q}_{n+1}=x+d$are independent.

Under the previous assumption, the joint probability

${\varphi}_{n,n+1}(x,x+d)$ can be written as the product of the two probability density functions

and its value depends on the type of model we choose.

Let us calculate the joint probability (

135) for the

log(

n)

-Model defined in Remark 18.

We adopt the following approximations

and

valid for both (this means the results we are going to obtain depend on

PNT only, not on the

Riemann Hypothesis).

and

Then (

135) becomes

and (

133), after the variable change

is written

Let

$\alpha $ be

then the integral

Finally, the probability mass function (

133) resulting from the

log(

n)

-Model under Assumption 2 and

$n\gg 1$ is (note it is independent of parameter

a)

Comparing the previous equation with (

132), we see the

log(

n)

-Model confirms Wolf’s conjecture, in particular the exponential decay of the pair number depending on

d, at least for large values of the gap

d, when Assumption 2 can be considered valid. Note that in the case of the

n-Model, we would get the same expression as in (

136), but with the function

n in place of

$lnn$. The fact that only the

RH rule compliant model agrees with the counting function of consecutive prime pairs, derived from empirical data, is a notable achievement of the theory, since it is a strong indication that the counting problem is deeply connected with the Riemann Hypothesis.

Figure 1 and

Figure 2 show the results obtained from the

log(

n)

-Model with respect to the actual numbers of pairs in two cases:

$49\times {10}^{6}<n\le 50\times {10}^{6}$ and

${2}^{47}\le {p}_{n}\le {2}^{48}$.

#### 5.3. A Heuristic Model of the Distribution of Prime Numbers

The generalized model we presented in

Section 5.1 can be directly related to the sequence of primes by changing condition (

115) into the following

which leads to the value

while the point of maximum of the probability density function (

113) becomes

It is interesting to note we would obtain the same expressions, with

$a=1$, if we substitute the condition (

137) with the following one, on the point of maximum of the function

${\varphi}_{n}(x)$In this case, the mean value of

${q}_{n}$ changes to

This model has the property to express the prime counting function

$\pi (k)$ through the values of the sequence of primes

${p}_{n}$ from

$n=1$ to

$n=k$. Let consider indeed the case when

$f(n)=\sigma $ is constant. In this case, the average of the random counting variable (

102) is

and it approximates the value of

$\pi (k)$ with any precision depending on

$\sigma $.

Indeed

since

we can write

Assuming

$l=\pi (k)$ and

${e}^{-a{e}^{\frac{-k+{p}_{l+1}}{\sigma}}}(k-l)\le 1$, (

140) easily follows.

Note that for each term of the sum (

139) it is

hence (

141).

From Equation (

137) we get in the case of the

log(

n)

-Model,

$f(n)=lnn$:

in the case of the

n-Model,

$f(n)=n$:

The probability functions above are valid for

$x\ge n$ (remember (

110)),

$n>1$ sufficiently large, and

$a={e}^{-\gamma}$.

**Definition** **10.** Equations (142)–(145) define the heuristic log(n)-Model and the heuristic n-Model respectively. Examples of different probability distribution functions

${\varphi}_{n}(x)$ resulting for these heuristic models are given in

Figure 3, for

$n=20,30,40$.

From

Figure 3, we see the dispersion of the random variable

${q}_{n}$ around its mean value

${p}_{n}$ is very small in the case of the

heuristiclog(

n)

-Model, so that we can assume the estimate

$\widehat{\pi}(k)$ is very close to the prime-counting function itself

$\pi (k)$ for this model as stated by Remark 22 in the particular case

$f(n)=constant$.

Table 5 shows some examples of estimate of

$\pi (k)$, calculated through the

heuristiclog(

n)

-Model with

$a={e}^{-\gamma}$, for different orders of magnitude.

The following considerations we propose in the case of the heuristic log(n)-Model, because of its relevance, are obviously valid in the case $f(n)=\sigma $, constant.

The following theorem gives a quantitative evaluation of the probability of error we do, when considering the random variable ${\xi}_{k}$ (in practice its mean value for small variances) as an estimate of $\pi (k)$.

**Theorem** **13.** Given the random variable${\xi}_{k}$of Definition 8,$\u03f5>0$, letbe the first kind error,the second kind error of${\xi}_{k}$at$k={p}_{n}$andthe sum of the two error probabilities. Then for the heuristic log(n)-Model defined by Equations (142) and (143) with$a={e}^{-\gamma}$it is **Proof.** From the theory of Gumbel distribution we know the variance of

${q}_{n}$ is

hence from Chebyshev’s inequality

It is

and

and, therefore, we can also write

From (

99), (

100) it follows

□

**Remark** **23.** Through the heuristic model we can derive new lower and upper bounds of the prime-counting function$\pi (k)$:where We know ([

41,

42]) the following lower and upper bounds of the

n-th prime

${p}_{n}$ hold

for

$n\ge 2$ the left-hand side and

$n\ge 6$ the right-hand side, hence for

${\mathsf{\Phi}}_{n}(k)$ given by (

143) it follows

and assuming

$k\gg 6$ sufficiently large so that the condition

$n\ge 6$ may be neglected, we can write (

147) for

$\widehat{\pi}(k)$ given by

From Remark 22 and Theorem 13, we know we can consider the approximation

$\widehat{\pi}(k)\approx \pi (k)$ as valid for the heuristic model, from which we get (

147).

## 6. Concluding Remarks

The first aim of this work was to deepen the problem of randomness in the distribution of prime numbers through such simple combinatorial objects as

First Occurrence Sequences, showing new analogies between the classical set partition problem and the distribution of primes themselves.

First Occurrence Sequences define a general class of objects for which the

Prime Number Theorem holds, such as for the prime sequence, but they fail to represent more stringent constraints, required by the

Riemann Hypothesis, such as the equivalent condition established by Helge von Koch I called

RH rule. In order to investigate this second step, the simple model must be generalized (or the class of combinatorial objects must be restricted) to discriminate between

RH rule compliant and noncompliant models. The analysis based on probability methods shows the

Riemann Hypothesis holds

w.p. 1 (together with the

Prime Number Theorem, of course) for the class of random sequences represented by the

log(

n)

-Model with mean equal to

$ali(n)$, the inverse function of the logarithmic integral function. Therefore, we can conclude that the property represented by the

Riemann Hypothesis through the

RH rule is largely independent of the primes and belongs to a large class of random sequences. Whether this class also contains the sequence of prime numbers cannot be decided by the model except statistically. Something similar happens within the context of analytical theory when speaking of zeta function

$\zeta (s)$, Dirichlet L-functions

$L(s,\chi )$ (Chap. 12, [

43]) (

s is the complex variable

$s=\sigma +it$), and the

Generalized Riemann Hypothesis “that is the hypothesis that not only

$\zeta (s)$ but all the functions

$L(s,\chi )$ have their zeros in the critical strip on the line

$\sigma =\frac{1}{2}$” (p. 124, [

44]).

Attempts to prove the Riemann hypothesis through the methods of physics go back as far as the so-called Hilbert–Polya conjecture, which associates the imaginary part of non-trivial zeros of

$\zeta (s)$ to the eigenvalues of some self-adjoint (Hermitian) operator that might be considered like the Hamiltonian of a physical system (the story of Hilbert–Polya conjecture is documented on Odlyzko’s personal website; see

http://www.dtc.umn.edu/~odlyzko/ accessed on 31 March 2021). Each type of combinatorial model we presented in the previous sections, based on probability equations such as (

111) and more generally (

25), can be transformed into a single particle Hamiltonian of an equivalent quantum system that emerges as a solution to an underlying combinatorial problem. This topic is outside the scope of this work and will not be treated here; I just want to mention that the analogy with the physical problem allows us to overcome some critical points of the combinatorial model and eliminate any arbitrariness in the choice of the mean of the random variable

${q}_{n}$ (the combinatorial counterpart of the

n-th prime). The solution

$ali(n)$ emerges as a general asymptotic solution for such models due to concepts such as interaction potential and energy levels, that play an important role also in describing integer sequences such as Fibonacci numbers and prime numbers, and the application of the Hellmann–Feynman theorem to the whole system (see [