On the counting function of semiprimes

A semiprime is a natural number which can be written as the product of two primes. The asymptotic behaviour of the function $\pi_2(x)$, the number of semiprimes less than or equal to $x$, is studied. Using a combinatorial argument, asymptotic series of $\pi_2(x)$ is determined, with all the terms explicitly given. An algorithm for the calculation of the constants involved in the asymptotic series is presented and the constants are computed to 20 significant digits. The errors of the partial sums of the asymptotic series are investigated. A generalization of this approach to products of $k$ primes, for $k\geq 3$, is also proposed.


Introduction
For a positive integer k and a positive integer (or real number) x, let πk(x) be the number of integers less than or equal x which can be written as the product of k prime factors.The behaviour of πk(x) has been extensively studied during last two centuries, with the main focus on the case k = 1, where π1(x) is the prime counting function, denoted π(x) in the rest of this paper.The prime number theorem states that π(x) ∼ li(x), where the logarithmic integral function li(x) = Rx 0 log−1 t dt can be written as an asymptotic expansion li(x) ∼ x log x P∞ n=0 n! (log x)n .Bounds on the error term have been established in the literature, including the recent work of Trudgian [22], who proved that, for sufficiently large x, This implies the existence of constants d1 and d2 such that Assuming the Riemann hypothesis, Rosser and Schoenfeld [19,20] established even sharper bounds on the error term, including for large enough x.Other explicit estimates of π(x), in terms of x and log x are achievable, as proved by Axler [1].
In this paper, we focus on the case k = 2, where the numbers written as products of two (not necessarily distinct) primes are called semiprimes.In this case, Ishmukhametov and Sharifullina [14] recently used probabilistic arguments to approximate the behaviour of π2(x) as The first term of (1.2) has already been known to Landau [15, §56], with his result stated, for general k ∈ N, as where we sum over all primes such that p ≤ x.In Section 3, we calculate the rest of constants Cn appearing in equation (1.5).They are given in Table 1 and obtained by the formula where Hi is the i-th harmonic number, B0 = M and constants Bi are defined u sing the asymptotic behaviour of sums [15, §56] Constants Bi are given as limits (3.1) in Section 3, where we present an algorithm to efficiently calculate them to a desired accuracy.They are computed in Table 1 to 20 significant digits.Rosser and Schoenfeld [18] prove that the error term in (1.8) can be given explicitly in terms of an integral, which contains the error terms in the prime number theorem.For the case i = 1 in equation (1.8), explicit estimates of this sum and, in particular, of the constant B1 involved, were recently obtained by Dusart [8].
A related arithmetic function, Ω(m), is defined to be the number of prime divisors of m ∈ N, where prime divisors are counted with their multiplicity.
Considering fixed x in equation (1.3), we can view this approximation of πk(x)/x as the probability mass function of the Poisson distribution with mean log(log(x)).Erd˝os and Kac [9] showed that the distribution of Ω(x) is Gaussian with mean log(log(x)) (see also R´enyi and Tur´an [17] and Harper [13] for generalizations and better bounds).Diaconis [7] obtained the asymptotic expansions for the average number of prime divisors as (see also Finch [11,Section 1.4.3].
where the constants γi are the Stieltjes constants, numerically computed in [3] to 20 significant digits.An asymptotic series for the variance of Ω have also been obtained [11,Section 1.4.3].
The Stieltjes constants γi are used in Section 3 during our calculation of the values of constants Bn and Cn, for n ∈ N.This paper is organized as follows.Section 2 begins with a counting lemma for expressing the semiprime counting function π2 in terms of the prime counting function π.Using this lemma, the main results on the asymptotic behaviour of π2 are stated and proved in Section 2 as Theorem 2.3 and Theorem 2.5.While Theorem 2.3 only gives the first two terms, its proof is more coincise than the proof of Theorem 2.5, which gives the full asymptotic series of π2.The constants Cn which appear in this asymptotic series are computed in Section 3, where we present an efficient approach to calculate both constants Bn and Cn, based on the differentiation of the prime zeta function.
In Section 4, we investigate the behaviour of the error terms given by the partial sums of the asymptotic series of π2.We conclude with a generalization of the counting argument in Section 5, discussing the extensions of the presented results to the general case of counting functions πk for k ≥ 3.

Asymptotic behaviour of the counting function of semiprimes
As in equation (1.6), we denote primes by p and the sums over p shall be understood as sums over all primes satisfying the given condition.In the case of summing over primes twice, we denote the corresponding prime summation indices by p1 and p2.We begin with a simple counting formula [14], that gives a way of computing π2(x).Substituting into equation (2.9), we obtain formula (2.8).

Asymptotic series for the counting function of semiprimes
To derive formulas for all terms in the asymptotic series of π2, we first define an auxiliary sequence of numbers qn for n ∈ N by Then qn is an increasing sequence of rational numbers with the first few terms given as q1 = 0, q2 = 1, q3 = 5/2, q4 = 29/6, q5 = 103/12 and q6 = 887/60, which satisfies the following identity.Integrating, we get which holds for t ∈ (−1, 1).Substituting t = 1/2, we obtain (2.12).
We will use Lemma 2.4 in the proof of the following theorem, giving the asymptotic series for the semiprime counting function π2(x).Using the inequality (1.1), there exist constants d1 and d2 such that where we define (note that we allow the second argument to be ∞ in this definition): Choose ℓ ∈ N. Our goal is to use (2.17) to estimate the rate of convergence of the sum on the right hand of equation (2.16).
To do this we first observe that, for i ≥ ℓ, we have Using inequalities (2.17This means that an asymptotic expansion of Sn(x 2 ) in terms of negative powers of log x is given by the sum of the asymptotic series of terms in equation (2.15).The same is true for Sn(x) in equation (2.14).Thus, using equations (2.4), (2.7), (2.12) and (2.14), we obtain Using equations (2.3) and (2.5), we have , where we used the definition (2.13) of Sn(x) to get the second equality.Using equation (2.19) and notation B0 = M, we obtain Thus, using formula (2.1) and the prime number theorem (2.2), we obtain the asymptotic expansion (1.5), where we have .This can be further simplified by using definition (2.11) of qn.We get

Research Article
Subtracting the first and the third sum, we obtain (1.7).

Computing the constants
In this section, we use a fast converging series to determine the values of the constants Bn and, as a result, of the constants Cn given by equation (1.7).The first constant, B0 = C0 = M, is the wellstudied Meissel-Mertens constant, so we will focus on constants Bn in the case n ≥ 1.They have been defined by equations (1.8) or (2.7), which can be rewritten as To derive a formula for evaluating Bn on a computer, we use the prime zeta function where the first term on the right hand side is a quickly converging series and the limit in the second term can be evaluated using the Laurent expansion of ζ(s) around s = 1.This is given by where the Stieltjes constants γn are computed to 20 significant digits in [3].Then, the Laurent expansion of the Research Article logarithmic derivative [4] of the Riemann zeta function is Constants Bn computed by formula (3.5) using the Laurent series (3.6) are presented in Table 1.Once we know constants Bn to the desired accuracy, we can use equation (1.7) to calculate constants Cn.They are also presented in Table 1 to 20 significant digits.

4.Discussion
In this paper, we have studied the behaviour of the semiprime counting function π2(x), which is a special case (k = 2) of the k-almost prime counting function πk(x).To generalize the presented results to the case k ≥ 3, we need to first generalize the counting Lemma 2.1.Using the inclusion-exclusion principle, it is possible to deduce the following counting formula where we define function π0(x) to be identically equal to 1, i.e. π0(x) = 1, and the sum over p1 < p2 < . . .< pi ≤ √k x means that we are summing i-times over all primes satisfying the given condition.Substituting k = 2 into equation (5.1), we obtain Using π0(x) = 1, we deduce equation (2.1).Thus, equation (5.1) provides a generalization of equation (2.1), which expresses the k-almost prime counting function πk(x) in terms of the counting functions π1(x), π2(x), . . ., πk−1(x).It can be inductively used to derive forms of coefficients of polynomials Pn,k in the asymptotic series (1.4).In addition to constants Bn and Cn, certain new constants will appear in such calculations, including the (converging) sums of the form P p (log p) ip −ℓ with ℓ ≥ 2 and i ∈ N.For a detailed discussion of the asymptotic behaviour of these sums for ℓ = 1, see Axler [2].Substituting n = π(x) in [2, Theorem 5] gives a different expansion for the sums in (1.8), which may be further examined using the prime number theorem.There are, also, other possible approximations for πk(x).For example, Erd˝os and S´ark˝ozy [10] prove that for some constants c(δ) and c.Other approximations, relating the function πk to some other products over primes are possible to obtain, as explained in [21].Functions πk(x) and Ω(x), used in expansion (1.9), count the prime divisors with their multiplicity.Another possible generalization is to investigate the related functions Nk(x) and ω(x), counting prime divisors without multiplicity.That is, functions Nk(x) and ω(x) are defined to be the number of natural numbers n ≤ x which have exactly k distinct prime divisors and the number of distinct prime divisors of x, respectively.Finch [11, page 26] shows that which has the higher order terms in the same form as in the expansion (1.9).Using the prime number theorem, we also observe that N1(x) = π (x) + π ( √ x) + π ( √3 x) + . . .∼ li(x) admits an identical asymptotic expansion as π(x).Delange where A > 0, 0 < δ < 1 and C ≈ 0.378694.Similar results, but for larger values of k, can be obtained for functions πk as well [16].

Delange [ 6 ,
Theorem 1] obtained the asymptotic expansion of πk(x) in the form where Pn,k are polynomials of degree k − 1, with the leading coefficient equal to n!/(k − 1)! .Tenenbaum [21] proved a similar result, giving an expression for the Research Article coefficients in the polynomial P0,k in terms of the derivatives of 1 Γ(z+1) Q p 1 + z p−1 1 − 1 p z evaluated at z = 0. Considering k = 2 in (1.4), we can write an asymptotic expansion for π2(x) as In Theorem 2.3, we prove that C0 = M, where M = 0.261497... is the Meissel-Mertens constant defined

Lemma 2 . 1 .
For a positive integer x, the following holds Proof.By the definition of counting functions π2 and π, we have and formula(2.1)follows by renaming p1 to p in the first term and observing that the rest of the right hand side is the sum of all natural numbers from 1 up to π( √ x) − 1. Formula (2.1) gives an expression of π2(x) in terms of the prime counting function π(x), which can be approximated using the prime number theorem [21] as where n ∈ N and Using Landau [15, §56], we can rewrite equation (1.6) for any integer n ∈ N as where we use the little o asymptotic notation [5], as opposed to the big O asymptotic notation used in the prime number theorem (2.2).First we use this result to approximate the sum on the right hand side of equation (2.1).Lemma 2.2.Let n ∈ N and αn(x) be defined by (2.3).Then we have Proof.Using equation (2.2), we have where c > 0 is a constant.Equation (2.5) then follows by estimating the right hand side by where the last equality follows from equation (2.4) 2.1 The first two terms of the asymptotic series for π2(x) Using (2.5) for n = 1, we obtain Using Landau [15, §56], we can rewrite equation (1.8) for any integers i ∈ N and n ∈ N as We will use this to prove the first theorem of this section.Theorem 2.3.Let M be the Meissel-Mertens constant defined by (1.6).Then Proof.Using equations (2.1), (2.2) for n = 1, and (2.6), we obtain Research Article We have the following identity Substituting the left hand side into the right hand side, we obtain, for any natural number n ∈ N, that Summing over all primes p ≤ √ x , we get Each term on the right hand side can be evaluated using equations (2.4) and (2.7), with o(1) accuracy, as where f(n) is a decreasing function of n satisfying f(n) → 0 as n → ∞.This can be deduced by applying equation (2.7) to the error term Since we have equation (2.10) implies that

Lemma 2 . 4 .
Let n ∈ N and let qn be given by equation (2.11).Then we have Proof.Considering the binomial series we can rewrite it as

Theorem 2 . 5 .
The constants Cn appearing in the asymptotic expansion (1.5) are given by equation (1.7) for n ∈ N and as C0 = B0 = M for n = 0. Proof.The case n = 0 is studied in Theorem 2.3, which states that C0 = M.To derive equation (1.7), we again use formula (2.1) from Lemma 2.1 and approximate each term using the prime number theorem (2.2).We need to analyze sums of the form Research Article Using the binomial series on the right hand side, we get Substituting x 2 for x, we obtain To estimate the sums over primes on the right hand side, we apply the result of Rosser and Schoenfeld [18, equation (2.26)], which can be formulated as where the error terms Li(x) are defined by Using this notation and identity (2.12) in Lemma 2.4, we rewrite equation (2.15) ) and (2.18) and assuming log(x) ≥ 1, we can estimate the remainder of the series on the right hand of equation (2.16) as Since all three sums on the right hand side converge independently of x, we deduce that the remainder is of the order O (log x) −(ℓ+1)).Therefore, equation (2.16) becomes.
[12] defined by Differentiating equation (3.2), we get the formula for the n-th derivative of the prime zeta function as The prime zeta function P(s) can also be related to the Riemann zeta function ζ(s) through the formula [12] where µ(n) is the M¨obius function.Taking the derivative of order n of this expression, we obtain Substituting into (3.3),we obtain Using integration by parts, we obtain Thus, the second sum on the right hand side of equation (3.4) can be approximated by Substituting into equation (3.4), we get Taking the limit as s → 1 and substituting into equation (3.1), we obtain Table 1.Table of constants Bn and Cn, for n = 0, 1, 2, . . ., 10, defined by equations (2.7) and (1.7), which appear in the asymptotic expansion of π2(x).The values of constants Bn are computed by formula (3.5) using the Laurent series (3.6).The values of constants Cn are computed by equation (1.7).
[6, Theorem 1] and Tenenbaum [21] obtained Research Article the asymptotic expansion of Nk(x) in the form where Qn,k are polynomials of degree k − 1.Here, the expansion is similar to the expansion (1.4) for πk(x), but the polynomials Pn,k and Qn,k are different.Results about the leading terms of polynomials Qn,k and about Q0,k have also been obtained, as in the case of πk.Several different approximations for Nk(x) are also possible to derive, as shown in Tenenbaum [21], who points out that the function Nk is easier to analyse than πk, for larger values of k, relative to log(log x).For example, the following holds uniformly for x ≥ 3 and (2 + δ) log(log x) ≤ k ≤ A log(log x):