Combinatorial Models of the Distribution of Prime Numbers

: This work is divided into two parts. In the ﬁrst one, the combinatorics of a new class of randomly generated objects, exhibiting the same properties as the distribution of prime numbers, is solved and the probability distribution of the combinatorial counterpart of the n -th prime number is derived together with an estimate of the prime-counting function π ( x ) . A proposition equivalent to the Prime Number Theorem ( PNT ) is proved to hold, while the equivalent of the Riemann Hypothesis ( RH ) is proved to be false with probability 1 ( w.p. 1 ) for this model. Many identities involving Stirling numbers of the second kind and harmonic numbers are found, some of which appear to be new. The second part is dedicated to generalizing the model to investigate the conditions enabling both PNT and RH . A model representing a general class of random integer sequences is found, for which RH holds w.p. 1 . The prediction of the number of consecutive prime pairs as a function of the gap d , is derived from this class of models and the results are in agreement with empirical data for large gaps. A heuristic version of the model, directly related to the sequence of primes, is discussed, and new integral lower and upper bounds of π ( x ) are found.


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 . . . } a sequence of independent random variables X n , taking values 0 and 1 according to , n > 2 (the probability may be arbitrarily chosen for n = 1, 2). Then, the random sequence of natural numbers S = {n : X n = 1, n > 1} is a stochastic model of the sequence of primes. This means that if Ω = {ω} is the set of all possible sequences ω realizations of S, then the prime sequence, say ω P , is obviously an element of Ω. We can therefore study the properties of the particular sequence ω P , through the methods of probability theory applied to the sample space Ω, and conjecture with Cramér that if a certain property holds in Ω with probability 1 (w.p. 1 in that follows), that is for almost all the sequences, the same property holds for the prime sequence ω 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 π(x) being the prime-counting function. We see from (1) that 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 , . . . ) 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 ≤ √ 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 −γ (γ 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 ≤ √ 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 2e −γ = 1.123 . . . ". 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 ) 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.  6 14. 7 13 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 L n/n = n n ∑ k=1 1 k ∼ n ln n.
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π(x) of the prime-counting function π(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 π(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.

First Occurrence Sequences: A New Class of Combinatorial Objects
In this section, we will be concerned about defining probability spaces and First Occurring Sequences as events and deriving some fundamental relations among the probability of certain events, while the evaluation of these probabilities will be treated in Section 3.

Definitions and Probability Spaces
Each FOS can be seen as a particular result of a sampling with replacement random experiment, consisting of a repeated sequence of independent trials with more than one outcome. The proper probability space for such an experiment can be defined as follows (see (Lect. 1, 2, [7]) and (Chap. 10, 13, [8])). Let A n be a collection of n distinct symbols A n = {a 1 , a 2 , . . . , a n }, n ≥ 2 and suppose our experiment of random draws from A n is repeated k times. Then, an outcome of the compound experiment is a k-length sequence of elements of A n ω n (k) = {(x 1 , x 2 , . . . , x k ) : x j ∈ A n , j = 1, 2, . . . , k}, k ≥ 1.
The probability space of the experiment is the triplet (Ω k n , F k n , P k n ), where is the sample space of all possible n k outcome sequences given by the k-fold Cartesian product of A n with itself Ω k n = A n × A n × · · · × A n , k times; F k n is the σ-algebra of subsets of Ω k n generated by finite-dimensional cylinder sets C n of the form with B i ∈ Bi = 1, 2, . . . , k, B a σ-algebra on A n of subsets of A n . To define the probability measure P k n : F k n → [0, 1], let us consider a collection of numbers {p i , i = 1, 2, . . . , n} such that The collection of numbers p i defines the probability P of any outcome a i of the single trial experiment and of any subset B ∈ B through the equations Assuming each trial is independent, the probability of an outcome ω n (k) of the compound experiment is given by The above equation defines a probability distribution on the sample space Ω k n , since it is (par. 2.3, [7]) and the probability measure P k n on the σ-algebra F k n can be generated by P through the formula P k I recall here two properties of P k n , which will be used throughout this paper.

Remark 2.
Given any finite-dimensional cylinder set (3) the probability measure P k n has the property (Corollary 2.1, [7]) where P is the probability distribution defined by (4)-(6) (obviously A n ∈ B anf if B i = A n for some i, it is P[A n ] = 1).
Among the events of the σ-algebra F k n we are interested in the following ones.

Definition 2.
We denote with S i/n (k), k-length sequences with i/n distinct symbols (1 ≤ i ≤ n, k ≥ i), the following events
Hence if we choose among the elementary outcomes in Ω k n , those with only i distinct symbols and denote them with ω i/n (k), the event S i/n (k) is the subset S i/n (k) = {ω i/n (k)}.
If we denote further with ω i/n (k) those outcomes in the above subset, where the i-th distinct symbol is unique (occurs once only) and occupies the last k-th position in the sequence, then the event FOS is the subset S i/n (k) = {ω i/n (k)}. The following remarks follow obviously from the above definitions.

Remark 3.
For every elementary event ω i/n (k) and ω i/n (k), there is one and only one ordered choice O i replicating the order of the first occurrence of the i distinct symbols in the elementary sequence.

Remark 4.
In general it is S i/n (k) ⊂ S i/n (k), the two events coincide when i = k = 1 and i = k = n. In these cases: S n/n (n) = S n/n (n) = {ω n/n (n)} where {ω n/n (n)} is the group of permutations of the set A n .
Let us now derive the general probability relation between events S i/n (k), S i/n (k) and elementary outcome sequences.

Definition 4.
Given a single k-length outcome with i/n distinct symbols ω i/n (k) (1 ≤ i ≤ n, k ≥ i), let us denote with Y(ω i/n (k)) the subset of i symbols occurring in ω i/n (k) Y(ω i/n (k)) = {a j ∈ A n : a j ∈ ω i/n (k)} and with Y c (ω i/n (k)) the complementary set of the remaining (n − i) symbols Y c (ω i/n (k)) = A n − Y(ω i/n (k)).
An analogous definition applies to the symbol set Y(ω i/n (k)) and the complementary symbol set Y c (ω i/n (k)) of an elementary outcome ω i/n (k). Obviously both Y and Y c are subsets of a σ-algebra B on A n of subsets of A n . Theorem 1. The probability of the events S i/n (k) and S i/n (k) as a function of elementary outcomes of the compound experiment and their symbol sets and complementary symbol sets, are given by Proof. For every sequence ω i−1/n (k − 1), the cylinder set contains (n − i + 1) FOS ω i/n (k) ∈ S i/n (k), and we get the whole event as the union of the disjoint cylinder sets From Equation (8), the probability of the cylinder set is given by and, hence, Equation (9) follows from the σ-additivity property of the probability measure. For every sequence ω i/n (j) (i ≤ j ≤ k), the cylinder set (when j = k the cylinder coincides with ω i/n (k)), contains i k−j sequences ω i/n (k) ∈ S i/n (k) and the whole event is the union of the disjoint cylinder sets ].
From Equation (8) the probability of the cylinder set is Equation (10) follows from the σ-additivity of the probability measure P k n .

Corollary 1.
Given i = n (the number of distinct symbols is equal to the total number of symbols in A n ) and k ≥ n then P k n [S n/n (k)] = k ∑ j=n P j n S n/n (j) .
Proof. When i = n the symbol set of FOS ω n/n (j), j ≥ i, becomes Y(ω n/n (j)) = A n and remembering P[A n ] = 1, the thesis follows immediately through simple manipulations of (10), after noting that the measure P k n of cylinder sets is equal to P j n measure of S n/n (j).
Dealing with FOS in general and problems such as the average length of sequences will require considering an infinite number of independent trials or repetitions of the random sampling with replacement experiment. The probability space (Ω k n , F k n , P k n ) we have defined above for finite values of k, can be generalized to consider sampling sequences of infinite length from the set A n , so that the set of all possible outcomes is Ω ∞ n , the Cartesian product of countable many copies of A n . The product measure (Theorem 6.3, p. 141, [8]) allows us to define an extended probability space (Ω ∞ n , F ∞ n , P ∞ n ) where sequences S i/n (k), for a fixed k, are subsets of Ω ∞ n defined as S i/n (k) × A n × A n × · · · ∈ F ∞ n and the probability measure and its properties remain unchanged (Par. 13.1, [8]) where P[ω i/n (k)] is defined in (6). The same obviously applies to S i/n (k) events.
If we consider only i/n FOS as outcomes of our experiment, We may define an even more straightforward probability space (Example 2, p. 270, [8]), say (Ω i/n , F i/n , P i/n ), where the sample space is the countable set and the probability of each elementary sample ω i/n (k) is defined as in (6), while for every event E ∈ F i/n it is Hence, the probability of the event S i/n (k) is still given by P i/n [S i/n (k)] = P k n [S i/n (k)]. Remembering the definition of partition of a sample space (p. 4, [7]), the following remarks follow immediately from the definitions above. Remark 6. Given k ≥ n, the collection of events {S i/n (k) i = 1, 2, . . . , n} is a partition of Ω k n . Hence S i/n (k).

Probability Relations
In order to simplify our expressions, let us adopt the following symbols for the probability of events S i/n (k) and S i/n (k), 1 This notation will be used throughout the paper. In the following we will derive some relations which are valid under the assumption of the general probability distribution (4)- (6).
Note that from Remarks 4 and 5 it follows φ n/n (n) = φ n/n (n) while from Remarks 6 and 7 Assuming k ≥ n, from (14) and Corollary 1, which can be written using the new notation it follows Since of course ∑ n−1 i=1 φ i/n (k) → 0 as k → ∞, it is interesting to note that the above equation is a heuristic proof of ∑ ∞ k=n φ n/n (k) = 1. From (14) with k = n, (12) and (15) with i = n, we can write the following equality From here on throughout this paper, we will assume that the the symbols in the set A n are equally probable; that is, with reference to the probability distribution (4)-(6), we will make the following assumption. Under the above assumption, the probability (6) of any sequence ω n (k) ∈ Ω k n is given by P[ω n (k)] = 1 n k while for the probability of FOS and related events it holds where the symbol "#S" denotes the cardinality of the set S. Hence Equation (12) can be completed in this case as φ n/n (n) = φ n/n (n) = n! n n .
while, since #S 1/n (k) = n, when k ≥ 1, it is The trivial case i = 1 is completely solved by Equations (11), (13) and (22), so in the following we shall assume i ≥ 2.
The following lemma follows directly from the definitions.

Lemma 1.
Under Assumption 1, the probability of the symbol set and its complementary (see Definition 4) of any outcome sequence ω n (k) is independent of the sequence and is given by By substituting these in (9) and (10) respectively, and remembering the definition (7) of the probability measure, Equations (23) and (24) follow.
Equation (25) is obtained simply by putting together the previous results.

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 S i/n (k) and S i/n (k) defined in Definition 2 and 3 The combinatorics of objects such as sequences ω i/n (k) ∈ 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 #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, 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 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.

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 A n , we denote with S i/n (k/O i ), k-length ordered First Occurrence Sequences (oFOS) with i/n distinct symbols on the ordered choice O i , (1 ≤ i ≤ n, k ≥ i), the events replicating the order of the first occurrence of its distinct i symbols.
The following example can help to clarify the above definition.
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 S i/n (k) is given by (1 ≤ i ≤ n, k ≥ 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 subject to the constraints through the following assignments: Therefore, the oFOS event is equal to As far as the cardinality of the sets from the above equation we get Since with C(n, i) i-combinations of n elements, and P (i) number of permutations of i elements, Equation (31) follows.

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 ≥ i we immediately get Indeed, for i = 2, there is only one oFOS, whatever the value of k ≥ 2. Note that (33) is a particular case of the general property The calculations are more complex when i ≥ 3.  . . .
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 , is starting with g(k, 1), k ≥ 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
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.
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 as starting 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 ≥ 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 and some manipulations, can be written as Finally we can write with a i+1,j given by (38), j = 1, 2, . . . , 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.
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 formula starting with a 3,1 = 1. (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).

Proof. Equation
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
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, . . . , 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 ∑ ∞ j=n φ n/n (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])

Ordered FOS and Stirling Numbers of the Second Kind
The solution we have found about the number of elementary sequences of the event S i/n (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 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 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) 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 S i/n (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 as that 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 which is the identity (47) mentioned above. This identity is thus closely related to the Stirling numbers and to the general property (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 #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.

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.

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 I k+1 = {1, 2, 3, 4, . . . , k, k + 1}, k ≥ 2, (k + 1) prime, there exists a sequence of (n + 1) successive primes O n+1 = {p 1 = 2, p 2 = 3, . . . , p n , p n+1 = k + 1} ⊂ I k+1 such that the prime-counting function π(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 π(k), as a random variable π o (k) with probability mass function defined by and, hence, from Theorem 5 , n = 1, 2, . . . , k.
Equation (53) defines a uniform probability distribution on the class Π k of partitions of a set of k elements, obtained by assigning the same probability B −1 k to each partition σ ∈ Π 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 Π 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 → ∞) 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 π o (k) with uniform probability (53), defined as a model of π(k), has mathematical expectation and variance asymptotically equal to (see Ch. 4, pp. 114-115 [19]) (1)), where r = W(k), the unique positive solution of re r = k, W(x) being the Lambert function [20] defined in the domain x ≥ −1/e. Since for the function W(k), we know it is r ∼ ln k as k → ∞, the above equations say the average and variance of the random variable π 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 → ∞, that is:

FOS Probabilities and Some Combinatorial Identities Involving Stirling Numbers
Let us collect, in this subsection, some formulas about the probability function φ i/n (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 ≤ i ≤ n, k ≥ i Finally, from (43) of Theorem 4 the explicit expression for φ i/n (k) follows If we set l = i − j − 1, the above equation can be written When i = n (n ≥ 2, k ≥ 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 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.
From (14) it follows From (16) it follows S(k, n) From (17) it follows 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 φ n/n (k), that clarify the probabilistic meaning of identity (46) and the close connection between these probabilities and the Stirling numbers of the second kind.

Proof of Equation (73). From (65)
By applying Lemma 3 Since we know that ∑ ∞ s=n φ n/n (s) = 1 and Finally from (75)  This identity thus has a probabilistic meaning connected with the normalization property of FOS probabilities. This asymptotic behavior follows very simply from Equation (74) due to the connection established between FOS probabilities and S(k, n).

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.
where the sign of |a i,1 | is negative if j is an even number, positive if it is an odd number.

Lemma 5.
Given σ i,j and τ 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, . . . , 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 ≥ 3, k ≥ i, the following bounds hold and, 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 we get the bounds of the ratio under condition i ln i < k.

FOS Average Length and Harmonic Numbers
As anticipated in the Introduction, calculating the average length of FOS sequences, that is, of elementary events ω i/n (k), k ≥ i of the countable space Ω i/n , 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, |q| < 1, then Lemma 7. Given p real, 0 < p ≤ 1, then Therefore, if we denote, in general, the quantity we are looking for with L i/n , 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 If we consider the set of discrete random variables q i/n with probability mass function φ i/n (k) = Prob{q i/n = k}, 1 ≤ i ≤ n, k ≥ i, then the quantity L i/n 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.

Corollary 7.
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 ≥ 3 and 3 ≤ i ≤ n, the following identity holds true where a i,j are the coefficients defined by Theorem 3.
Proof. By substituting in (91) the term φ i/n (k) as given by (58), we get 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 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 ≥ 3 and 3 ≤ i ≤ n, the following identity holds true When i = n we get for the n-th harmonic number

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 ≥ 2, there exists an event FOS S n/n (p n ) ∈ Ω n/n = ∞ k=n S n/n (k) (see Remark 7), and the whole sequence of prime numbers corresponds to the element (S n/n (p n ), n = 2, 3, . . . ) ∈ U of the product set U = ∞ ∏ n=2 Ω n/n , we can define as FOS universe.
The model based on FOS takes then into consideration the set Ω n/n 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 function φ n/n (k) = Prob{q n = k}, k = n, n + 1, n + 2, . . . , with φ n/n (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 φ n/n (k) = n! n k S(k − 1, n − 1), k ≥ n and the mean value of q n E[q n ] = L n/n = nH n ∼ n ln n.
Hence, given k ≥ n, k integer, the probability distribution function of q n 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 ξ k whose probability distribution is induced by q n through the following and obviously In our combinatorial model, ξ k is associated with the value π(k) of the prime-counting function, considered as a random variable assuming integer values between 1 and k. Theorem 8. The discrete random variable ξ k with probability distribution (99) assumes values between 1 and k, has probability mass function and mathematical expectation Proof. From (98), due to the properties of S(k, n) numbers, we get for n = 1 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 ξ k is given by that is the same as Equation (102) since Φ k+1 (k) = 0.

Remark 15.
The mean value of the discrete random variable ξ k is equal to The previous theorem suggests to assume E[ξ k ] as an estimateπ(k) derived from the combinatorial model of the prime-counting function π(k), that is, remembering the equality (98)π An alternative expression forπ(k) can be derived from Remark 15 and Equation (73) To check the quality of the functionπ(k) as a numerical estimate of π(k), Equation (104) looks more suitable since it can be written in a recursive form. Indeed, if we put with w(k, n) = (n − 1)! n k−1 S(k, n), from the recursive equation of the Stirling numbers of the second kind (51), we get the following recurrence for the terms w(k, n) w(k + 1, n) = w(k, n) + n − 1 n k w(k, n − 1),k ≥ 1, 1 ≤ n ≤ (k + 1) initialized as w(k, 1) = 1, k ≥ 1 w(1, n) = 0, n > 1. Table 3 reports a series of values of the recursive estimateπ(k), compared with the prime-counting function π(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π(k), we look for a continuous approximation of the probability function Φ n (k). After promoting k and n to be continuous variables, which is a justifiable assumption for k 1 and considering the relation (98) between Φ and S, Equation (97) is written as Taking the derivative of the above equation, we get the differential equation for Φ that can be written as We set where λ 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 Φ n (k → ∞) = 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 → ∞) 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 choose and 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 < k ln k , coinciding asymptotically with the region of validity of (88), n ln n < k.
As a continuous approximation of the probability function Φ n (k) we are looking for, let us choose a parameter function depending on n only through the following simple relation λ n (k) = λ n = an, a > 0 constant , 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 λ n = en, while for k n, we know it is hence λ n = n. Therefore (107) becomes and from (102) and (104), we get the continuous approximation ofπ(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 π(k) up to k = 10 27 (data with π(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π(k) defined by (109). Theorem 9. Given > 0, however small, it holds Proof. Φ 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 writê and, due to the decreasing of Φ n (k) with n, Given , 0 < < 1, let 1 γ = 1 + 2 , hence 2 3 < γ < 1, and then the previous inequalities become (note that n 1 (k) < k for 1 γ < ln k) The limit for k → ∞ of the left-hand and the right-hand side of the previous inequality, say L(k) and R(k) respectively, gives lim k→∞ L(k) = 1, 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 π(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) = x 0 dt ln t , 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 ξ k , defined above as the stochastic counterpart of π(k) in our model.

Theorem 10.
Let ξ k then random variable with probability distribution (99), then it is

Proof.
Let Since it is easy to see that both Φ n(k) (k) and Φ 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 ξ 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.

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 ξ 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.

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, ∞) according to the following probability distribution function with Φ 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 φ n/n (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 The complete expressions of the probability density and distribution function are Note that φ 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 γ = 0.57721 . . . 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 Γ(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 1 sufficiently large, so we can neglect the terms e −λ n e −n/ f (n) and E 1 (λ n e − n f (n) ). Note that the function E 1 (x) decreases rapidly as x → ∞, in particular [31], (1.4) e −x 2 ln 1 + 2 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 λ n = an, a > 0, constant (in particular when a = e −γ it is E[q n ] = n ln n). 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) = ln n. 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) = ln n 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 λ n = ae n , a = e −γ .
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 : R → (1, +∞) 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 with r n = ali(n). The double exponential distribution function (122) is often called Gumbel distribution [33,34]. it is o(e − k n ) as k → ∞ and deviates asymptotically from the Stirling number ratio which is ∼ e − k n .
Briefly speaking, the log(n)-Model defined above corresponds to a subset of the FOS universe 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π(k) becomeŝ In addition, for this function we can enunciate a proposition, which is the equivalent of the Prime Number Theorem.
Theorem 11. Given > 0 however small, there exists k 0 such that for k > k 0 it holds where the functionπ(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 ξ 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.
from which, grouping the terms by powers of f (1) (x), the thesis follows.
Theorem 12. Let ξ 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 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 which can be written From the asymptotic expansion of li(x) we get which leads to the following expression for ln n(k) From (124) and (125) we finally get −k + ali(n(k)) ln n(k) Through analogous calculations for m(k) we find 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 U ⊂ 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, . . . } belongs to the set U , 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 U as a stochastic process {q n , n = 1, 2, 3, . . . } of random variables differently distributed and the sequence of primes as particular realization of the process.
Different bounds of the difference |p n − ali(n)| ≤ δ n 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]) δ n = 1 π √ n(ln n) 5/2 , n ≥ 11.
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).
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 ∼ n ln n and π(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 as The gap g n can be modeled as the difference between the random variables g n = q n+1 − q n with probability mass function where φ 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 2 sufficiently large, the two events q n = x and q n+1 = x + d are independent.
Under the previous assumption, the joint probability φ 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 ln (n + 1) ≈ ln n and r n+1 ≈ r n + ln n, n > 1, valid for both (this means the results we are going to obtain depend on PNT only, not on the Riemann Hypothesis). r n = n ln n and r n = ali(n).

Then (135) becomes
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 ln n. 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. Figures 1 and 2 show the results obtained from the log(n)-Model with respect to the actual numbers of pairs in two cases: 49 × 10 6 < n ≤ 50 × 10 6 and 2 47 ≤ p n ≤ 2 48 .

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 λ n = ae pn f (n) , with a = e −γ 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 φ n (x) x M = f (n) ln (λ n ) = p n .
In this case, the mean value of q n changes to E q n = p n + γ f (n).
This model has the property to express the prime counting function π(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) = σ is constant. In this case, the average of the random counting variable (102) is and it approximates the value of π(k) with any precision depending on σ.

Remark 22. It holds
Assuming l = π(k) and e −ae −k+p l+1 σ (k − l) ≤ 1, (140) easily follows. Note that for each term of the sum (139) it is From Equation (137) we get in the case of the log(n)-Model, f (n) = ln n: φ n (x) = a ln n e − x−pn ln n e −ae − x−pn ln n , Φ n (x) = e −ae − x−pn ln n ; in the case of the n-Model, f (n) = n: φ n (x) = a n e − x−pn n e −ae − x−pn n , Φ n (x) = e −ae − x−pn n .
The probability functions above are valid for x ≥ n (remember (110)), n > 1 sufficiently large, and a = e −γ . Examples of different probability distribution functions φ 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 heuristic log(n)-Model, so that we can assume the estimatê π(k) is very close to the prime-counting function itself π(k) for this model as stated by Remark 22 in the particular case f (n) = constant. Table 5 shows some examples of estimate of π(k), calculated through the heuristic log(n)-Model with a = e −γ , 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) = σ, constant.
The following theorem gives a quantitative evaluation of the probability of error we do, when considering the random variable ξ k (in practice its mean value for small variances) as an estimate of π(k). Theorem 13. Given the random variable ξ k of Definition 8, > 0, let ξ p n − ≥ n = π(p n ) be the first kind error, ξ p n + < n = π(p n ) the second kind error of ξ k at k = p n and W ξ (n, ) = Prob{ξ p n − ≥ n} + Prob{ξ p n + < n} the sum of the two error probabilities. Then for the heuristic log(n)-Model defined by Equations (142) and (143) with a = e −γ it is W ξ (n, ) ≤ π 2 6 ln 2 n 2 .
Proof. From the theory of Gumbel distribution we know the variance of q n is E (q n − p n ) 2 = π 2 6 ln 2 n hence from Chebyshev's inequality Prob{|q n − p n | ≥ } ≤ π 2 6 ln 2 n 2 .
We know ( [41,42]) the following lower and upper bounds of the n-th prime p n hold α(n) < p n < β(n) for n ≥ 2 the left-hand side and n ≥ 6 the right-hand side, hence for Φ n (k) given by (143) it follows e −ae −k+β(n) ln n ≤ Φ n (k) ≤ e −ae −k+α(n) ln n , n ≥ 6, and assuming k 6 sufficiently large so that the condition n ≥ 6 may be neglected, we can write (147) forπ(k) given byπ (k) = k ∑ n=1 Φ n (k).
From Remark 22 and Theorem 13, we know we can consider the approximation π(k) ≈ π(k) as valid for the heuristic model, from which we get (147).

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 ζ(s), Dirichlet L-functions L(s, χ) (Chap. 12, [43]) (s is the complex variable s = σ + it), and the Generalized Riemann Hypothesis "that is the hypothesis that not only ζ(s) but all the functions L(s, χ) have their zeros in the critical strip on the line σ = 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 ζ(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 [45] for a mathematical foundation of the theorem). These methods result in computational benefits improving the estimates obtained from the combinatorial model and may suggest new conjectures about the distribution of primes. In [29], the quantum model derived from what we have called n-Model is developed and applied to explore the region beyond the Skewes number in connection with the numerical results known in the literature derived through analytical methods.
These two topics (the parallelism between the treatment from the point of view of random sequences and of Riemann zeta and Dirichlet L-functions; the transposition of the problem into a quantum physics framework), seem worthy of being addressed in future work.