# On twin prime distribution and associated biases

Shaon Sahoo

► To cite this version:

Shaon Sahoo. On twin prime distribution and associated biases. 2025. hal-05161729

HAL Id: hal-05161729

https://hal.science/hal-05161729v1

Preprint submitted on 15 Jul 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
ON TWIN PRIME DISTRIBUTION AND ASSOCIATED BIASES

SHAON SAHOO

ABSTRACT. A modified totient function ($\phi_2$) is seen to play a significant role in the study of the twin prime distribution. The function is defined as $\phi_2(n) := \#\{a \le n | a(a+2) \text{ is coprime to } n\}$ and is shown here to have following product form: $\phi_2(n) = n(1 - \frac{\theta_p}{2}) \prod_{p>2, p|n} (1 - \frac{2}{p})$, where $p$ denotes a prime and $\theta_n = 0$ or 1 for odd or even $n$ respectively. Using this function it is proved for a given $n$ that there always exists a number $m > n$ so that $(p, m(m+2)) = 1$ for every prime $p \le n$. We also establish a Legendre-type formula for the twin prime counting function in the following form: $\pi_2(x) - \pi_2(\sqrt{x}) = \sum_{ab|P(\sqrt{x})} \mu(ab) \lfloor \frac{x-l_{a,b}}{ab} \rfloor$, where $P(z) = \prod_{p \le z} p$ and $a$ is always odd. Here $l_{a,b}$ is the lowest positive integer so that $a|l_{a,b}$ and $b|(l_{a,b}+2)$.

In the latter part of this work, we discuss three different types of biases in the distribution of twin primes. The first two biases are similar to the biases in primes as reported by Chebyshev, and Oliver and Soundararajan. Our third reported bias is on the difference ($D$) between (the first members of) two consecutive twin primes; it is observed that $D \pm 1$ is more likely to be a prime than an odd composite number.

CONTENTS

<table><tr><td>1. Introduction</td><td>1</td></tr><tr><td>2. Notations and definitions</td><td>2</td></tr><tr><td>3. Arithmetic progressions and twin primes</td><td>3</td></tr><tr><td>4. Functions &mu;<sub>2</sub>(n) and &phi;<sub>2</sub>(n)</td><td>5</td></tr><tr><td>5. Function &phi;<sub>2</sub>(n) and twin primes</td><td>7</td></tr><tr><td>6. Eratosthenes sieve and Legendre's formula for twin primes</td><td>10</td></tr><tr><td>7. Proofs of Theorems 4.1 and 6.1</td><td>11</td></tr><tr><td>8. Some standard results</td><td>13</td></tr><tr><td>9. Biases in twin prime distribution</td><td>14</td></tr><tr><td>9.1. Type-I bias</td><td>14</td></tr><tr><td>9.2. Type-II bias</td><td>16</td></tr><tr><td>9.3. Type-III bias</td><td>17</td></tr><tr><td>References</td><td>18</td></tr></table>

1. INTRODUCTION

Important proven results are scarce in the study of twin primes. The statements about the infinitude of twin primes and corresponding distribution are the well known conjectures in this field. Although unproven so far, there are some important

Key words and phrases. Twin primes, Arithmetic progression, Chebyshev's bias.
breakthroughs towards proving these conjectures. Chen’s work [1] and more recent
work by Zhang [2] may be noted in this regard.

In this work we study some new aspects of the distribution of twin primes; we especially focus on studying the twin primes in arithmetic progressions. Many important results are known when primes are studied in residue classes. For example, Dirichlet’s work (1837) shows that, if $(a, q) = 1$, there exists infinite number of primes $p$ so that $p \equiv a \pmod q$. In analogy with these studies, one can also study twin primes after classifying them according to the residues of their first members. In this study of twin primes, a modified totient function $(\phi_2)$ is seen to play a role similar to that of the Euler’s totient function in the study of primes. We analyze this modified totient function and an associated modified Möbius function $(\mu_2)$.

For the twin primes, we also discuss in this work a sieve similar to the sieve of Eratosthenes and a formula similar to the Legendre's formula for the prime counting function. We also provide a new heuristics for the twin prime conjecture using the modified totient function $\phi_2$.

While studying primes in residue classes, one of the most interesting results
that came out is the biases or, as popularly known, the prime number races [3].
Chebyshev (1853) first noted that certain residue classes are surprisingly more
preferred over others. For example, if $\pi(x; q; a)$ denotes the number of primes
$\le x$ in the residue class $a$ (mod $q$), it is seen that $\pi(x; 4; 3) > \pi(x; 4; 1)$ in most
occasions. A detailed explanation of this bias (Chebyshev's) is given by Rubinstein
and Sarnak in their 1994 paper [4]. More recently (2016), a different type of bias
was reported by Oliver and Soundararajan [5]. They found that a prime of a certain
residue class is more likely to be followed by a prime of another residue class. A
conjectural explanation was presented to understand such bias.

In the last part of this paper we discuss similar biases in the distribution of
the twin prime pairs. In addition, we also report a third type of bias: if $(\hat{p}_n -
\hat{p}_{n-1})$ represents the difference between the first members of two consecutive twin
prime pairs, then $(\hat{p}_n - \hat{p}_{n-1} \pm 1)$ are more likely to be prime numbers than to be
composites. We also find that the possibility of $(\hat{p}_n - \hat{p}_{n-1} - 1)$ to be a prime is
more than that of $(\hat{p}_n - \hat{p}_{n-1} + 1)$ to be a prime. The numerical results presented
here are based on the analysis of the first 500 million primes $(\pi(x_0) = 5 \times 10^8)$ and
corresponding about 30 million twin prime pairs $(\pi_2(x_0) = 29,981,546)$. Here $x_0$
is taken as the last prime we consider, i.e. 11,037,271,757.

Besides these studies, we also state a conjecture regarding the arithmetic pro-
gression of twin primes in the line with the Green-Tao theorem and give some
numerical examples of this type of progression.

2. NOTATIONS AND DEFINITIONS

In this paper the letters $i, j, a, b, q, n$ and $N$ represent positive integers. The letters $x, y, z$ and $c$ represent real numbers, and $p$ always represents a prime number with $p_n$ being the $n$-th prime number. Here $\hat{p}$ represents a twin prime pair whose first member is $p$; $\hat{p}_n$ denotes the $n$-th twin prime pair. Unless mentioned otherwise, any statement involving a twin prime pair will be interpreted with respect to the first member of the pair, e.g., $\hat{p} \le x$ means that the first prime of the pair is less than or equal to $x$, or $\hat{p} \equiv a \pmod q$ means that the first member of the pair is congruent to $a \pmod q$.
We denote gcd of $a$ and $b$ by $(a, b)$. In this paper we denote a reduced residue class of $q$ by a number $a$ if $(a, q) = 1$ and $0 < a < q$. A pair of integers are called a *coprime pair* to a third integer if both the integers are individually coprimes to the third integer; e.g., 6 and 14 form a coprime pair to 25. A coprime pair to an integer is called a *twin coprime pair* if the integers in the pair are separated by 2.

The functions $\mu(n)$ and $\phi(n)$ respectively denote the Möbius function and Euler's totient function. The functions $\omega(n)$ and $\omega_o(n)$ denote respectively the number of prime divisors and odd prime divisors of $n$ (for odd $n$, $\omega(n) = \omega_o(n)$, and for even $n$, $\omega(n) = \omega_o(n) + 1$).

Definitions:

$$ \phi_2(q) := \#\{a \le q \mid (a, q) = 1 \text{ and } (a+2, q) = 1\}. $$

$$ \mu_2(n) := \mu(n)2^{\omega_o(n)}. $$

$$ \pi(x) := \#\{p \le x\}. $$

$$ \pi(x; q; a) := \#\{p \le x \mid p \equiv a(\text{mod } q)\}. $$

$$ \pi(x; q; a_i|a_j) := \#\{p_n \le x \mid p_n \equiv a_i(\text{mod } q) \text{ and } p_{n+1} \equiv a_j(\text{mod } q)\}. $$

$$ \delta(x; q; a) := \frac{\pi(x; q; a)}{\pi(x)}. $$

$$ \delta(x; q; a_i|a_j) := \frac{\pi(x; q; a_i|a_j)}{\pi(x; q; a_i)}. $$

$$ \Delta(x; q; a_i, a_j) := \pi(x; q; a_i) - \pi(x; q; a_j). $$

$$ \bar{\Delta}(x; q; a_i, a_j) := \Delta(x; q; a_i, a_j) \frac{\ln(x)}{\sqrt{x}}. $$

$$ \pi^{\pm}(x) := \#\{p_n \le x \mid (p_{n+1} - p_n \pm 1) \text{ is a prime}\} $$

$$ \delta^{\pm}(x) := \frac{\pi^{\pm}(x)}{\pi(x)}. $$

$$ \pi_2(x) := \#\{\hat{p} \le x\}. $$

$$ \pi_2(x; q; a) := \#\{\hat{p} \le x \mid \hat{p} \equiv a(\text{mod } q)\}. $$

$$ \pi_2(x; q; a_i|a_j) := \#\{\hat{p}_n \le x \mid \hat{p}_n \equiv a_i(\text{mod } q) \text{ and } \hat{p}_{n+1} \equiv a_j(\text{mod } q)\}. $$

$$ \delta_2(x; q; a) := \frac{\pi_2(x; q; a)}{\pi_2(x)}. $$

$$ \delta_2(x; q; a_i|a_j) := \frac{\pi_2(x; q; a_i|a_j)}{\pi_2(x; q; a_i)}. $$

$$ \Delta_2(x; q; a_i, a_j) := \pi_2(x; q; a_i) - \pi_2(x; q; a_j). $$

$$ \bar{\Delta}_2(x; q; a_i, a_j) := \Delta_2(x; q; a_i, a_j) \frac{\ln^2(x)}{10\sqrt{x}}. $$

$$ \pi_2^{\pm}(x) := \#\{\hat{p}_n \le x \mid (\hat{p}_{n+1} - \hat{p}_n \pm 1) \text{ is a prime}\} $$

$$ \delta_2^{\pm}(x) := \frac{\pi_2^{\pm}(x)}{\pi_2(x)}. $$

### 3. ARITHMETIC PROGRESSIONS AND TWIN PRIMES

Unlike the case of prime numbers where each reduced residue class has infinite number of primes (Dirichlet's Theorem), in case of the twin primes, some reduced residue class may not have more than one prime pair. This is because the existence of the second prime adds extra constraint on the first one. For example, there is no twin prime pair in the residue class $a = 1$ (mod 6). For $q = 10$, the residue class $a = 3$ has only one prime pair, namely 3 and 5. These observations can be concisely presented in the following theorem.

**Theorem 3.1.** The reduced residue class $a$ (mod $q$) can not have more than one twin prime pair when $(a + 2, q) > 1$. For such $a$, if both $a$ and $a + 2$ are prime numbers, then they represent the only twin prime pair in the residue class $a$.
This theorem can simply be proved by noting that for any prime $p \equiv a \pmod q$, $p+2$ will be forced to be a composite if $(a+2, q) \neq 1$. Here only exception may happen when the number $a+2$ is itself a prime number. In such a case, if $a$ is also a prime number, then the pair consisting of $a$ and $a+2$ is the only twin prime pair in the class $a$.

It may be mentioned in the passing that some non-reduced residue class may have one twin prime pair. For example, when $q = 9$, residue class $a = 3$ has one prime pair, namely 3 and 5.

Theorem 3.1 helps us to come up with a conjecture for twin primes in the line of the Dirichlet's Theorem for prime numbers. For that we first define below an admissible class in the present context of twin prime distribution.

**Definition 3.1.** A residue class $a \pmod q$ is said to be admissible if $(a, q) = 1$ and $(a+2, q) = 1$.

With this definition of admissible class, we now propose the following conjecture.

**Conjecture 3.1.** Each admissible residue class of a given modulus contains infinite number of twin prime pairs.

A stronger version of this conjecture can be formulated with the definition of a modified totient function $\phi_2(q)$. This function gives the number of admissible residue classes modulo $q$.

**Definition 3.2.** The function $\phi_2(q)$ denotes the number of admissible residue classes modulo $q$, i.e., $\phi_2(q) = \#\{a < q \mid (a, q) = 1 \text{ and } (a+2, q) = 1\}$.

Clearly $\phi_2(q) \leq \phi(q)$, where $\phi(q)$ is the Euler's totient function. While calculating $\phi_2(q)$, a reduce residue class $a$ is excluded if there exists a prime divisor $(p)$ of $q$ so that $p|a+2$. This observation helps us to deduce that $\phi_2(2^n) = \phi(2^n) = 2^{n-1}$ for $n \geq 1$, and for any odd prime $p$, $\phi_2(p^m) = \phi(p) - p^{m-1} = p^m(1 - 2/p)$ when $m \geq 1$. In Section 7 we prove that

$$ \phi_2(q) = q \prod_{p|q} \left(1 - \frac{2}{p}\right) \text{ for odd } q, \text{ and} $$

$$ \phi_2(q) = q \left(1 - \frac{1}{2}\right) \prod_{p>2, p \mid q} \left(1 - \frac{2}{p}\right) \text{ for even } q. $$

If we take $\phi_2(1) = 1$ then the function $\phi_2(q)$ is multiplicative. Above formula for $\phi_2(q)$ is stated as a theorem in Section 4.

The function $\phi_2(q)$ can also be expressed in terms of the principal Dirichlet character $(\chi_1)$ in the following way: $\phi_2(q) = \sum_{i=1}^{q} \chi_1(i)\chi_1(i+2) = \sum_{k=1}^{\phi(q)} \chi_1(a_k+2)$, where the second sum is over the reduced residues $(a_k)$. The values of the function for some integers are as follows: $\phi_2(4) = \phi(4) = 2$, $\phi_2(6) = \phi(6) - 1 = 1$, $\phi_2(7) = \phi(7) - 1 = 5$ and $\phi_2(9) = \phi(9) - 3 = 3$.

Using the function $\phi_2(q)$, we now propose the following conjecture regarding the twin prime counting function for a given admissible class.

**Conjecture 3.2.** For a given $q$ and an admissible class $a \pmod q$, we have

$$ \lim_{x \to \infty} \frac{\pi_2(x)}{\pi_2(x; q; a)} = \phi_2(q). $$
We end this section with a conjecture on the arithmetic progression of twin primes in line with the Green-Tao theorem [6]. For some positive integers $a$ and $b$, let the sequence $a+kb$ represents (first members of) twin primes for $k = 0, 1, 2, \dots, l-1$ ($l > 2$). This sequence is said to represent an arithmetic progression of twin primes with $l$ terms.

**Conjecture 3.3.** For every natural number $l$ ($l > 2$), there exist arithmetic progressions of twin primes with $l$ terms.

Some examples for the arithmetic progressions of twin primes are as follows: 41+420·k, for $k = 0, 1, \dots, 5$; 51341+16590·k, for $k = 0, 1, \dots, 6$; 2823809+570570·k, for $k = 0, 1, \dots, 6$. Each number in a progression represents the first member of a twin prime.

### 4. FUNCTIONS $\mu_2(n)$ AND $\phi_2(n)$

We begin this section with the following definition of a modified Möbius function $\mu_2(n)$.

**Definition 4.1.** If $\omega_o(n)$ denotes the number of odd prime divisors of $n$, then the modified Möbius function is defined as

$$ \mu_2(n) = \mu(n) 2^{\omega_o(n)}, $$

where $\mu(n)$ is the Möbius function.

The function $\mu_2(n)$ is multiplicative. The values of $\omega_o(n)$ for some $n$ are as follows: $\omega_o(1) = 0$, $\omega_o(2) = 0$, $\omega_o(3) = 1$ and $\omega_o(6) = 1$.

The main reason we defined $\mu_2(n)$ is that it is possible to express $\phi_2(n)$ in terms of this modified Möbius function. The following theorem (4.1) gives two different expressions of $\phi_2(n)$. The proof of the theorem is given in Section 7.

**Theorem 4.1.** The function $\phi_2(n)$, as defined in Definition 3.2, takes the following product form

$$ (4.1) \qquad \phi_2(n) = n \left(1 - \frac{\theta_n}{2}\right) \prod_{p>2, \ p|n} \left(1 - \frac{2}{p}\right), $$

where $\theta_n$ is either 0 or 1 depending on whether $n$ is odd or even respectively. Furthermore, using $\mu_2(n)$ function, one can express $\phi_2(n)$ as the following divisor sum:

$$ (4.2) \qquad \phi_2(n) = n \sum_{d|n} \frac{\mu_2(d)}{d}. $$

In the following we discuss some properties of the functions $\mu_2(n)$ and $\phi_2(n)$.

**Lemma 4.1.** The divisor sum of the function $\mu_2$ is given by

$$ \sum_{d|n} \mu_2(d) = \begin{cases} 0 & \text{if } n \text{ is even} \\ (-1)^{\omega(n)} & \text{if } n \text{ is odd.} \end{cases} $$

*Proof.* The formula is true for $n = 1$ since $\mu_2(1) = \mu(1)2^0 = 1$. Assume now that $n > 1$ and is written $n = p_1^{a_1} p_2^{a_2} \cdots p_k^{a_k}$. First we take $n$ to be even with $p_1 = 2$ and $a_1 \ge 1$. We note that for any odd divisor $d$, there is an even divisor $2d$ so that
$\mu_2(d) + \mu_2(2d) = 0$. It may be noted that we have $\mu_2(2^a d) = 0$ for $a > 1$. This shows that $\sum_{d|n} \mu_2(d) = 0$ when $n$ is even.

We now take $n$ to be odd. Using Lemma 8.1, we get the following.

$$ \sum_{d|n} \mu_2(d) = \sum_{d|n} \mu(d) 2^{\omega_o(d)} = \prod_{p|d} (1-2) = (-1)^{\omega(n)}. $$

□

**Lemma 4.2.** If $n = \prod_{p|n} p^{a_p}$, then the divisor sum of the function $\phi_2$ is given by

$$ \sum_{d|n} \phi_2(d) = n \prod_{p>2, \ p|n} \frac{\phi_2(p) + p^{-a_p}}{\phi(p)}. $$

*Proof.* For odd $n$, taking advantage of the multiplicative property of $\phi_2$, we write $\sum_{d|n} \phi_2(d) = \prod_{p|n} \{1+\phi_2(p)+\phi_2(p^2)+\cdots+\phi_2(p^{a_p})\}$. Now since $\phi_2(p^m) = p^m(1-\frac{2}{p})$ for odd $p$ and $m \ge 1$, we get $\sum_{d|n} \phi_2(d) = \prod_{p|n} \frac{p^{a_p}(p-2)+1}{p-1} = n \prod_{p|n} \frac{\phi_2(p)+p^{-a_p}}{\phi(p)}$. For even $n$, there will be an additional multiplicative factor to this result; the factor is $(1+\phi_2(2)+\phi_2(2^2)+\cdots+\phi_2(2^{a_2})) = 2^{a_2}$. This factor is a part of $n$. □

**Theorem 4.2.** Let $D(\mu_2, s)$ denote the Dirichlet series for $\mu_2$, i.e., $D(\mu_2, s) := \sum_{n=1}^{\infty} \frac{\mu_2(n)}{n^s}$. We have

$$ D(\mu_2, s) = \left(1 - \frac{1}{2^s}\right) \prod_{p>2} \left(1 - \frac{2}{p^s}\right) \text{ for } \mathrm{Re}(s) > 1. $$

*Proof.* First we note that $2^{\omega_o(n)} \le 2^{\omega(n)} \le d(n)$, where $d(n)$ counts the number of divisors of $n$. It is known that $\sum_{n=1}^{\infty} \frac{d(n)}{n^s}$ is an absolutely convergent series for $\mathrm{Re}(s) > 1$ (chapter 11, [7]); this implies that the series $\sum_{n=1}^{\infty} \frac{\mu_2(n)}{n^s}$ also converges absolutely for $\mathrm{Re}(s) > 1$.

Using Lemma 8.2, we have $D(\mu_2, s) = \prod_p \{1 + \frac{\mu_2(p)}{p^s}\} = (1 - \frac{1}{2^s}) \prod_{p>2} (1 - \frac{2}{p^s})$. □

**Theorem 4.3.** Let $D(\phi_2, s)$ denote the Dirichlet series for $\phi_2$, i.e., $D(\phi_2, s) := \sum_{n=1}^{\infty} \frac{\phi_2(n)}{n^s}$. We have

$$ D(\phi_2, s) = \zeta(s-1)D(\mu_2, s) \text{ for } \mathrm{Re}(s) > 2, $$

where $\zeta(s-1)$ is the Riemann zeta function.

*Proof.* We first note that $\phi_2(n) \le n$. So the series $\sum_{n=1}^{\infty} \frac{\phi_2(n)}{n^s}$ is absolutely convergent for $\mathrm{Re}(s) > 2$. The theorem now can be simply proved by taking $f(n) = \mu_2(n)$ and $g(n) = n$ in the Theorem 8.1. □

**Remark.** We here note that $\frac{1}{D(\mu_2, s)} = (1 - \frac{1}{2^s})^{-1} \prod_{p>2} (1 - \frac{2}{p^s})^{-1} = (1 + \frac{1}{2^s} + \frac{1}{2^{2s}} + \cdots) \prod_{p>2} (1 + \frac{2}{p^s} + \frac{2^2}{p^{2s}} + \cdots) = \sum_{n=1}^{\infty} \frac{2^{\Omega_o(n)}}{n^s}$, where $\Omega_o(n)$ counts the number of odd prime divisors of $n$ with multiplicity. Now in analogy with the relation $(\sum_{n=1}^{\infty} \frac{\mu(n)}{n^s})^{-1} = \zeta(s)$, one may define $\zeta_2(s) := \sum_{n=1}^{\infty} \frac{2^{\Omega_o(n)}}{n^s}$ so that Theorems 4.2 and 4.3 can be written respectively as $D(\mu_2, s) = 1/\zeta_2(s)$ and $D(\phi_2, s) = \zeta(s-1)/\zeta_2(s)$.
**Theorem 4.4.** We have the following weighted average of $\mu_2(n)$:

$$ \sum_{n \le x} \mu_2(n) \left[ \frac{x}{n} \right] = L(x) + L\left(\frac{x}{2}\right) + 2L\left(\frac{x}{4}\right) + 4L\left(\frac{x}{8}\right) + \dots, $$

where $L(x) = \sum_{n \le x} (-1)^{\omega(n)}$. It is understood that $L(x) = 0$ for $0 < x < 1$.

*Proof.* Using Theorem 8.3 with $f(n) = \mu_2(n)$ and $g(n) = 1$, we get

$$ \begin{aligned} \sum_{n \le x} \mu_2(n) \left[ \frac{x}{n} \right] &= \sum_{n \le x} \sum_{d|n} \mu_2(d) \\ &= \sum_{\text{odd } n \le x} (-1)^{\omega(n)} \quad (\text{using Lemma 4.1}) \\ &= L(x) - \sum_{n \le x/2} (-1)^{\omega(2n)} \quad (\text{where } L(x) = \sum_{n \le x} (-1)^{\omega(n)}) \end{aligned} $$

Since $\sum_{n \le x/2} (-1)^{\omega(2n)} = \sum_{\text{odd } n \le x/2} (-1)^{\omega(2n)} + \sum_{n \le x/4} (-1)^{\omega(4n)}$ and $\omega(2n) = \omega(n) + 1$ for odd $n$, we get $K(x) = L(x) + K(\frac{x}{2}) - \sum_{n \le x/4} (-1)^{\omega(4n)}$, where $K(x) = \sum_{n \le x} \mu_2(n) \left[ \frac{x}{n} \right]$. Now manipulating the last term repeatedly we get the following series: $K(x) = L(x) + K(\frac{x}{2}) + K(\frac{x}{4}) + K(\frac{x}{8}) + \dots$. This series can be further manipulated to find $K(x)$ in the following way: $K(x) = L(x) + L(\frac{x}{2}) + 2L(\frac{x}{4}) + 4L(\frac{x}{8}) + \dots$. $\square$

### 5. FUNCTION $\phi_2(n)$ AND TWIN PRIMES

We noted in Conjecture 3.2 how $\phi_2(n)$ can be helpful in studying the twin prime distributions. In this section we will present some more observations on how $\phi_2(n)$ can be useful in the study of twin primes. First we mention a simple application of $\phi_2(n)$ in the form of the following theorem.

**Theorem 5.1.** For a given $l \ge 1$, consider a set $\mathcal{P}$ of any $l$ distinct primes. There always exists a number $m > 1$ so that $(p, m(m+2)) = 1$ for every prime $p \in \mathcal{P}$.

*Proof.* When $l = 1$ and $p \ge 5$, from Theorem 4.1, we get $\phi_2(p) \ge 2$. This confirms the existence of at least one $m > 1$ so that $(p, m(m+2)) = 1$. It is also easy to explicitly check that the theorem is correct when $p = 2$ or 3.

When $l = 2$, and two primes are 2 and 3, we can explicitly check that the theorem is valid. For example, $m = 5$ works here. When one or both primes are 2 or 3, it is easy to see that $\phi_2(p_1p_2) \ge 2$ for two primes $p_1$ and $p_2$.

When $l \ge 3$, we can define $P_l = \prod_{p \in \mathcal{P}} p$, and note that $\phi_2(P_l) \ge 2$. Which confirms the existence of at least one $m > 1$ so that $(p, m(m+2)) = 1$ for every prime $p \in \mathcal{P}$. $\square$

**Corollary 5.1.** For a given $n > 2$, there always exists a number $m > n$ so that $(p, m(m+2)) = 1$ for every prime $p \le n$.

*Proof.* This corollary can be shown to be a consequence of Theorem 5.1. We will give here a separate direct proof of the corollary. Let $P_n = \prod_{p \le n} p$. From Theorem
4.1, we have $\phi_2(P_n) = \prod_{\text{odd } p \le n} (p-2) \ge 1$. We recall that, between 1 and $P_n$, there are $\phi_2(P_n)$ twin coprime pairs to $P_n$. In this case all these pairs (one pair when $2 < n < 5$) lie above $n$. This proves the theorem. $\square$

This theorem tells us that it is always possible to find a twin coprime pair to the primordial ($P_n$) upto a given number ($n > 2$). It may be mentioned here that we can have a stronger statement than the Corollary 5.1 by noting that there are $\phi_2(P_n)$ number of twin coprime pairs in ($n, P_n$). It is also interesting to note that the Theorem 5.1 implies that there are infinite number of primes.

According to the Hardy-Littlewood conjecture, $\pi_2(x) \sim 2C_2 \frac{x}{(\ln x)^2}$, where $C_2$ is the so-called twin prime constant; this constant is given by the following product form: $C_2 = \prod_{p>2} \frac{p(p-2)}{(p-1)^2}$. In terms of $\phi(n)$ and $\phi_2(n)$, this constant can be written in the following series forms,

$$ (5.1) \qquad C_2 = \sum_{\text{odd } n=1}^{\infty} \frac{\mu(n)}{\phi^2(n)}, \quad \text{and} $$

$$ (5.2) \qquad \frac{1}{C_2} = \sum_{\text{odd } n=1}^{\infty} \frac{\mu^2(n)}{n\phi_2(n)}. $$

Both the equations can be proved by expressing their right hand sides as Euler products (see also Lemma 8.2; to use it in the present context, leave out the sum over the even numbers from the left side and drop $p=2$ from the right side of the equation). The Equation 5.1 also appears in [8].

Let $P_n$ denote the product of the first $n$ primes, i.e., $P_n = \prod_{k=1}^n p_k$. It is easy to check that

$$ (5.3) \qquad 2C_2 = \lim_{n \to \infty} \frac{P_n \phi_2(P_n)}{\phi^2(P_n)} = \lim_{n \to \infty} \frac{\phi_2(P_n^2)}{\phi^2(P_n)}. $$

The last expression of $C_2$, as appears in Equation 5.3, is especially interesting here. It helps us to view the Hardy-Littlewood twin prime conjecture from a different angle. We explain this in the following.

**Heuristics for twin prime conjecture.** We take $X = P_x = \prod_{p \le x} p$ for large $x$. The number of integers which are coprime to and smaller than $X$ is $\phi(X)$. It may be mentioned here that all the coprimes, except 1, lie in $[x, X]$. The total number of the coprime pairs of all possible gaps is $\frac{1}{2}\phi(X)(\phi(X) - 1) \sim \frac{1}{2}\phi^2(X)$. Among these pairs, the number of the twin coprime pairs (pairs with gap = 2) is $\phi_2(X)$. All these twin coprime pairs lie in $[x, X]$. So in $[x, X]$, the fraction of the coprime pairs which are the twin coprime pairs is $\frac{2\phi_2(X)}{\phi^2(X)}$. Now the number of primes in $[x, X]$ is $\pi(X) - \pi(x) \sim \pi(X)$. The number of the all possible prime pairs (with any non-zero gap) is $\frac{1}{2}\pi(X)(\pi(X) - 1) \sim \frac{1}{2}\pi^2(X)$. Among these prime pairs, the number of the twin prime pairs in $[x, X]$ would then be: $\pi_2(X) - \pi_2(x) \sim \frac{1}{2}\pi^2(X) \times \frac{\phi_2(X)}{\phi^2(X)}$. From the prime number theorem we know $\pi(X) \sim \frac{X}{\ln X}$. So for large $X$, we finally get $\pi_2(X) \sim \frac{X^2}{\ln^2 X} \times \frac{\phi_2(X)}{\phi^2(X)} = \frac{X}{\ln^2 X} \times \frac{\phi_2(X)}{\phi^2(X)}$. Now $\frac{X\phi_2(X)}{\phi^2(X)}$ converges to $2C_2$ as noted in Equation 5.3; this implies: $\pi_2(X) \sim 2C_2 \frac{X}{\ln^2 X}$.
Above argument can also be given in the following ways. We note that $\frac{\pi^2(X)}{\phi^2(X)}$ denotes the fraction of the coprime pairs which are the prime pairs (of any possible gaps). Now there are $\phi_2(X)$ twin coprime pairs; among them, the number of twin prime pairs would then be $\frac{\pi^2(X)}{\phi^2(X)} \times \phi_2(X) \sim 2C_2 \frac{X}{\ln^2 X}$. We also note that $\frac{\pi(X)}{\phi(X)}$ is the probability of a coprime to be a prime. So $(\frac{\pi(X)}{\phi(X)})^2$ is the probability that the two members of a coprime pair are both primes. This suggest that the number of the twin prime pairs among $\phi_2(X)$ twin coprime pairs is $(\frac{\pi(X)}{\phi(X)})^2 \times \phi_2(X) \sim 2C_2 \frac{X}{\ln^2 X}$.

In the preceding heuristics, the reason we take $X$ to be a large primordial (product of primes upto some large number) is that the density of coprimes vanishes for this special case $(\phi(X)/X \to 0$ as $X \to \infty$; see Theorem 5.2). This vanishing density is a desired property in our heuristics as we know that the density of primes has this property $(\pi(N)/N \to 0$ as $N \to \infty$). If we take any arbitrary form of $X$ then the density of coprimes may not vanish. We may also note here that, as $X \to \infty$, $\frac{X\phi_2(X)}{\phi^2(X)}$ goes to a limit when the special form of $X$ is taken. On the other hand if $N$ increases arbitrarily then the function $\frac{N\phi_2(N)}{\phi^2(N)}$ does not have any limit.

Next we discuss the estimated values of $\phi(X)/X$ and $\phi_2(X)/X$ when $X$ is the product of primes upto $x$.

**Theorem 5.2 (Mertens' result).** As $x \to \infty$, we have $\prod_{p \le x} (1 - \frac{1}{p}) = \frac{e^{-\gamma}}{\ln x} + O(\frac{1}{\ln^2 x})$. Here $\gamma \approx 0.577216$ is the Euler-Mascheroni constant.

The proof of this result can be found in the most standard text books.

**Theorem 5.3.** As $x \to \infty$, we have $(1 - \frac{1}{2}) \prod_{2 < p \le x} (1 - \frac{2}{p}) = 2C_2 \frac{e^{-2\gamma}}{\ln^2 x} + O(\frac{1}{\ln^3 x})$. Here $C_2$ is the twin prime constant and $\gamma$ is the Euler-Mascheroni constant.

*Proof.* It is possible to prove Theorem 5.3 directly using the result from Theorem 5.2. It can be done in the following way.

$$ (1 - \frac{1}{2}) \prod_{2 < p \le x} (1 - \frac{2}{p}) = \left( 2 \prod_{2 < p \le x} \frac{1 - \frac{2}{p}}{(1 - \frac{1}{p})^2} \right) \prod_{p \le x} (1 - \frac{1}{p})^2. $$

Now as $x \to \infty$, $2 \prod_{2 < p \le x} \frac{1 - \frac{2}{p}}{(1 - \frac{1}{p})^2} = 2C_2$ and the last part can be estimated from

Mertens' second result, $\prod_{p \le x} (1 - \frac{1}{p})^2 = \frac{e^{-2\gamma}}{\ln^2 x} + O(\frac{1}{\ln^3 x})$. This finally gives us

$$ (1 - \frac{1}{2}) \prod_{2 < p \le x} (1 - \frac{2}{p}) = 2C_2 \frac{e^{-2\gamma}}{\ln^2 x} + O(\frac{1}{\ln^3 x}). \quad \square $$

<figure><img src="image_2.png" /></figure>

The function $\phi_2(n)$ also gives a non-trivial upper bound for $\pi_2(n)$. We make a formal statement in terms of the following theorem.

**Theorem 5.4.** For $n > 2$, $\pi_2(n) \le \phi_2(n) + \omega(n)$.
By taking $n$ to be a large primordial (product of primes upto about $\ln n$), we see that for $n \to \infty$, using Theorem 5.3, $\pi_2(n) \le \phi_2(n) + \omega(n) \sim \frac{2C_2ne^{-2\gamma}}{(\ln \ln n)^2}$. This upper bound, of course, is not very tight; a much better bound can be found directly from $\pi(n)$. We note that, except 5, no other prime number is part of two twin prime pairs; accordingly: $\pi_2(n) \le \frac{1}{2}\pi(n) \sim \frac{n}{2\ln n}$.

## 6. ERATOSTHENES SIEVE AND LEGENDRE'S FORMULA FOR TWIN PRIMES

The Eratosthenes sieve gives us an algorithm to find the prime numbers in a list of integers. The Legendre's formula uses the algorithm to write the prime-counting function in the following mathematical form: $\pi(x) - \pi(\sqrt{x}) + 1 = \sum_{d|P(\sqrt{x})} \mu(d) \lfloor \frac{x}{d} \rfloor$, where $P(z) = \prod_{p \le z} p$. Here we first discuss a similar sieve to detect the twin primes in $[1, x]$. This sieve may be called the Eratosthenes sieve for the twin primes. We use this sieve then to write a mathematical formula for twin-prime counting function - which may be called the Legendre's formula for twin primes.

**Eratosthenes sieve for twin primes.** Assume that we are to find out the (first members) of twin primes in $[1, N]$ with $N > 2$. To start the sieving process, we first take a list of integers from 2 to $N + 2$. We then carry out the following steps. Take the lowest integer ($n$) available in the list (initially $n = 2$), and then remove (slashes “/” in the example below) the integers from the list which are multiples of but greater than $n$. Then remove (strike-outs “—” in the example below) the integers from the list which are two less than the integers removed in the last step. Circle the lowest integer available in the list (3 in the first instance). Now repeat the process with the circled number (new $n$) and continue the process till we reach $N$ in the list. At the end of the process, the circled numbers are the (first members) of the twin primes in $[1, N]$.

**Example.** To find the (first members) of twin primes below 30, we take the following list of numbers from 2 to 32. We then carry out the above mentioned steps to circle out the twin primes below 30.

2 (③) 4 (⑤) 6 (⑧) 9 (⑩) 11 (⑫) 13 (⑬) 14 (⑭) 15 (⑮) 16 (⑯) 18 (⑰) 19 (⑱) 20 (⑲) 21 (⑳) 23 (㉑) 24 (㉒) 25 (㉓) 26 (㉔) 27 (㉕) 28 (㉖) 29 (㉗) 30 (㉘) 31 (㉙) 32

So the twin primes (first members) below 30 are 3, 5, 11, 17 and 29.

**Legendre's formula for twin primes.** The main idea behind the sieve above can be used to find a formula for $\pi_2(x)$. We write this formula as a theorem below. The proof of the theorem is given in Section 7.

**Theorem 6.1.** If $P(z) = \prod_{p \le z} p$ and $[x]$ denotes the greatest integer $\le x$, we have

$$ (6.1) \qquad \pi_2(x) - \pi_2(\sqrt{x}) = \sum_{ab|P(\sqrt{x})} \mu(ab) \lfloor \frac{x - l_{a,b}}{ab} \rfloor, $$

where $a$ takes only odd values and $b$ takes both odd and even values. Here $l_{a,b}$ is the lowest (positive) integer which is divisible by $a$ and simultaneously $l_{a,b} + 2$ is divisible by $b$. If we consider $l_{a,b} = at_{a,b}$, then $t_{a,b}$ is the solution of the congruence $at_{a,b} + 2 \equiv 0 \pmod{b}$ with $0 < t_{a,b} < b$ when $b > 1$. For $b = 1$, we take $t_{a,b} = 1$.
## 7. PROOFS OF THEOREMS 4.1 AND 6.1

We will prove Theorem 4.1 by two methods - first by the principle of cross-classification (inclusion-exclusion principle) and then by the Chinese remainder theorem. The first method is also used for proving Theorem 6.1.

### Proof of Theorem 4.1

*Method 1:* We first assume that $n$ is an odd number and $p_1, \dots, p_r$ are the distinct prime divisors of $n$. Let $S = \{1, 2, \dots, n\}$ and $S_k = \{m \le n : p_k|m(m+2)\}$. It is clear that

$$ \phi_2(n) = N \left( S - \bigcup_{i=1}^{r} S_i \right), $$

where $N(T)$ denotes the number of elements in a subset $T$ of $S$. Now by the principle of cross-classification (see Theorem 8.2 for notations and formal statement), we have

$$ \phi_2(n) = N(S) - \sum_{1 \le i \le r} N(S_i) + \sum_{1 \le i < j \le r} N(S_i S_j) - \dots + (-1)^r N(S_1 S_2 \cdots S_r). $$

We have $N(S) = n$ and $N(S_i) = 2 \frac{n}{p_i}$. In general, to calculate $N(S_{k_1} \cdots S_{k_l})$, we write $N(S_{k_1} \cdots S_{k_l}) = \sum_{d|P_l} N(A_{P_l}^d)$ where $P_l$ is the product of given $l$ primes

corresponding to the sets $S_{k_1}, S_{k_2}, \dots, S_{k_l}$, and $A_{P_l}^d = \{m \le n : d|m \text{ and } d'|m+2\}$ with $dd' = P_l$. For $d' = 1$, $N(A_{P_l}^d) = \frac{n}{P_l}$. For $d' > 1$, $N(A_{P_l}^d)$ is given by the number of solutions for $a$ in the congruence $da + 2 \equiv 0 \pmod{d'}$ so that $0 < da \le n$. This congruence has a unique solution modulo $d'$; let $t$ be the solution where $1 \le t < d'$. All the solutions for $a$ would then be in the form $t + sd'$ where $s$ is so that $0 < (t + sd')d \le n$. We have now $s \le \frac{n}{P_l} - \frac{t}{d'}$. Since $\frac{n}{P_l}$ is an integer and $\frac{t}{d'} < 1$, the maximum value of $s$ can be $\frac{n}{P_l} - 1$. On the other hand, the minimum value of $s$ is 0. This gives $N(A_{P_l}^d) = \frac{n}{P_l}$. Since there are $2^l$ distinct divisors of $P_l$, we get $N(S_{k_1} \cdots S_{k_l}) = 2^l \frac{n}{P_l}$. Now using the principle of cross-classification, we get

$$ \phi_2(n) = n - 2 \sum_{1 \le i \le r} \frac{n}{p_i} + 2^2 \sum_{1 \le i < j \le r} \frac{n}{p_i p_j} - \dots (-1)^r 2^r \frac{n}{p_1 \cdots p_r} = n \sum_{d|n} \frac{\mu_2(d)}{d}. $$

If $n$ is even, we can take $p_1 = 2$ and correspondingly $S_1 = \{m \le n : p_1|m\}$. We now have $N(S_1) = \frac{n}{p_1}$. To find $N(S_1 S_{k_1} \cdots S_{k_l})$, where the sets $S_{k_1}, S_{k_2}, \dots, S_{k_l}$ correspond to $l$ different odd primes, we write $N(S_1 S_{k_1} \cdots S_{k_l}) = \sum_{d|P_l} N(A_{P_l}^d)$. Here $P_l$ is the product of given $l$ odd primes, and $A_{P_l}^d = \{m \le n : d|m \text{ and } 2d'|m+2\}$ with $dd' = P_l$. For $d' = 1$, $N(A_{P_l}^d) = \frac{n}{2P_l}$. For $d' > 1$, $N(A_{P_l}^d)$ is given by the number of solutions for $a$ in the congruence $da + 2 \equiv 0 \pmod{2d'}$ so that $0 < da \le n$. Proceeding as before, we find that $N(A_{P_l}^d) = \frac{n}{2P_l}$ and $N(S_1 S_{k_1} \cdots S_{k_l}) = 2^l \frac{n}{2P_l}$. Using these values, we finally get $\phi_2(n) = n \sum_{d|n} \frac{\mu_2(d)}{d}$. We may here note that the distinctiveness of even $n$ is taken care by $\mu_2(n)$ which is defined by $\mu_2(n) = \mu(n)2^{\omega_0(n)}$ where $\omega_0(n)$ is the number of odd prime divisors of $n$.

*Method 2:* Let $n = p_1^{a_1} p_2^{a_2} \cdots p_r^{a_r}$. Now consider the system of congruences with $i$-th congruence as $x \equiv b_i \pmod{p_i^{a_i}}$, where $(b_i, p_i) = (b_i + 2, p_i) = 1$ and $0 < b_i < p_i^{a_i}$. In the congruence, $b_i$ can take $\phi_2(p_i^a)$ values, where, as discussed in Section 3, $\phi_2(p^a) = p^a(1 - \frac{2}{p})$ for an odd prime $p$, and $\phi_2(p^a) = p^a(1 - \frac{1}{p})$ for the even prime $p = 2$. For a given set $(b_1, b_2, \dots, b_r)$, the system of congruences has a unique
solution modulo $n$ according to the Chinese remainder theorem. So for all possible values of $(b_1, b_2, \cdots b_r)$, there are $\prod_r \phi_2(p_r^{a_r})$ unique solutions which lie above 0 and below $n$.

**Proof of Theorem 6.1**

To find the number of twin primes in $[\sqrt{x}, x]$, we can suitably use the concept behind the Eratosthenes sieve for twin primes discussed in Section 6. To translate this concept in the mathematical form, we adopt here the approach which is used in the proof (Method 1) of Theorem 4.1.

As before, we take $p_1 = 2$ and $S_1 = \{m \le x : p_1|m\}$. For any odd prime $p_k$, we take $S_k = \{m \le x : p_k|m(m+2)\}$. This sets help us to write

$$ \pi_2(x) - \pi_2(\sqrt{x}) = N \left( S - \bigcup_{1 \le k \le r} S_k \right), $$

where $r = \pi(\sqrt{x})$ and $N(T)$ denotes the number of elements in a subset $T$ of $S$. Now by the principle of cross-classification (Theorem 8.2), we have

$$ (7.1) \qquad \pi_2(x) - \pi_2(\sqrt{x}) = N(S) - \sum_{1 \le i \le r} N(S_i) + \sum_{1 \le i < j \le r} N(S_i S_j) - \cdots \\ \qquad \qquad \qquad \qquad \qquad + (-1)^r N(S_1 S_2 \cdots S_r). $$

We have $N(S) = [x]$, $N(S_1) = [\frac{x}{p_1}]$ for $p_1 = 2$, and $N(S_i) = 2[\frac{x}{p_i}]$ for odd primes. In general, to find $N(S_{k_1} \cdots S_{k_l})$, where the sets $S_{k_1}, S_{k_2}, \cdots, S_{k_l}$ correspond to $l$ different odd primes, we write $N(S_{k_1} \cdots S_{k_l}) = \sum_{d|P_l} N(A_{P_l}^d)$ where $P_l$ is the product

of given $l$ odd primes and $A_{P_l}^d = \{m \le x : d|m \text{ and } d'|m+2\}$ with $dd' = P_l$. For $d' = 1$, $N(A_{P_l}^d) = [\frac{x}{P_l}]$. For $d' > 1$, $N(A_{P_l}^d)$ is given by the number of solutions for $a$ in the congruence $da + 2 \equiv 0 \pmod{d'}$ so that $0 < da \le x$. This congruence has a unique solution modulo $d'$; let $t_{d,d'}$ be the solution where $1 \le t_{d,d'} < d'$. All the solutions for $a$ would then be in the form $t_{d,d'} + sd'$ where $s$ is so that $0 < d(t_{d,d'} + sd') \le x$. Since $t_{d,d'} < d'$, $s$ can not be a negative integer. In other way, when $dt_{d,d'} > x$ or $s \le \frac{x}{P_l} - \frac{t_{d,d'}}{d'} < 0$, then we do not have any solution for $a$; hence in such a case $N(A_{P_l}^d) = 0$. Since $\frac{t_{d,d'}}{d'} < 1$, we have $-1 < \frac{x}{P_l} - \frac{t_{d,d'}}{d'}$. So in the case when $dt_{d,d'} > x$, we can write $N(A_{P_l}^d) = 1 + [\frac{x}{P_l} - \frac{t_{d,d'}}{d'}]$. When $dt_{d,d'} \le x$ or $\frac{x}{P_l} - \frac{t_{d,d'}}{d'} \ge 0$, then $s$ can take any value from 0 to $[\frac{x}{P_l} - \frac{t_{d,d'}}{d'}]$. Therefore, in this case also $N(A_{P_l}^d) = 1 + [\frac{x}{P_l} - \frac{t_{d,d'}}{d'}]$.

To find $N(S_1 S_{k_1} \cdots S_{k_l})$, where the sets $S_{k_1}, S_{k_2}, \cdots, S_{k_l}$ correspond to $l$ different odd primes, we write $N(S_1 S_{k_1} \cdots S_{k_l}) = \sum_{d|P_l} N(A_{P_l}^d)$. Here $P_l$ is the product of given $l$ odd primes, and $A_{P_l}^d = \{m \le x : d|m \text{ and } 2d'|m+2\}$ with $dd' = P_l$. For $d' = 1$, $N(A_{P_l}^d) = [\frac{x}{2P_l}]$. For $d' > 1$, $N(A_{P_l}^d)$ is given by the number of solutions for $a$ in the congruence $da + 2 \equiv 0 \pmod{2d'}$ so that $0 < da \le x$. Let $t_{d,2d'}$ be the unique solution of the congruence, where $0 < t_{d,2d'} < 2d'$. All the solutions for $a$ would then be in the form $t_{d,2d'} + 2sd'$ where $s$ is so that $0 < d(t_{d,2d'} + 2sd') \le x$. Proceeding as for the odd $n$ case, we find that $N(A_{P_l}^d) = 1 + [\frac{x}{2P_l} - \frac{t_{d,2d'}}{2d'}]$.
If we denote $N(S)$ by $N(1)$, $N(S_i)$ by $N(p_i)$, $N(S_iS_j)$ by $N(p_ip_j)$ and so on, we can rewrite Equation 7.1 in the following way,

$$ (7.2) \qquad \pi_2(x) - \pi_2(\sqrt{x}) = \sum_{a|P(\sqrt{x})} \mu(a)N(a), $$

where $P(\sqrt{x}) = \prod_{p \le \sqrt{x}} p$. Now $N(a) = \sum'_{d|a} N(A_{P_d}^d)$ where $\sum'$ indicates the sum over only the odd divisors $(d)$ of $a$ and $N(A_{P_d}^d) = 1 + \left[ \frac{x}{a} - \frac{t_{d,d'}}{d'} \right]$ with $d' = a/d$ for $d' > 1$. Here $0 < t_{d,d'} < d'$ and $dt_{d,d'} + 2 \equiv 0 \pmod{d'}$. For $d' = 1$, we take $t_{d,d'} = 1$. Using the result that $\sum_{d|n} \mu(d) = 0$ for $n > 1$, we finally get from Equation 7.2, $\pi_2(x) - \pi_2(\sqrt{x}) = \sum_{dd'|P(\sqrt{x})} \mu(dd') \left[ \frac{x}{dd'} - \frac{t_{d,d'}}{d'} \right]$, where $d$ is always odd and $d'$ can take both odd and even values.

## 8. SOME STANDARD RESULTS

In this section we will provide some useful standard results without their proofs.

**Theorem 8.1.** Consider two functions $F(s)$ and $G(s)$ which are represented by the following two Dirichlet series,

$$ F(s) = \sum_{n=1}^{\infty} \frac{f(n)}{n^s} \quad \text{for } \mathrm{Re}(s) > a, \text{ and} $$

$$ G(s) = \sum_{n=1}^{\infty} \frac{g(n)}{n^s} \quad \text{for } \mathrm{Re}(s) > b. $$

Then in the half-plane where both the series converge absolutely, we have

$$ F(s)G(s) = \sum_{n=1}^{\infty} \frac{h(n)}{n^s}, $$

where $h = f * g$, the Dirichlet convolution of $f$ and $g$:

$$ h(n) = \sum_{d|n} f(d)g(\frac{n}{d}). $$

The series for $F(s)$ and $G(s)$ are absolutely convergent respectively for $\mathrm{Re}(s) > a$ and $\mathrm{Re}(s) > b$. The proof of the theorem can be found in any standard number theory text book (e.g. chapter 11, [7]).

**Lemma 8.1.** For a multiplicative function $f$, we have

$$ \sum_{d|n} \mu(d) f(d) = \prod_{p|n} (1 - f(p)) \quad \text{and} $$

$$ \sum_{d|n} \mu^2(d) f(d) = \prod_{p|n} (1 + f(p)). $$
**Lemma 8.2.** Let $f$ be a multiplicative function so that the series $\sum_n f(n)$ is absolutely convergent. Then the sum of the series can be expressed as the following absolutely convergent infinite product over all primes,

$$ \sum_{n=1}^{\infty} f(n) = \prod_{p} \{1 + f(p) + f(p^2) + \cdots\}. $$

**Theorem 8.2 (Principle of cross-classification).** Let $S$ be a non-empty finite set and $N(T)$ denotes the number of elements of any subset $T$ of $S$. If $S_1, S_2, \dots, S_n$ are given subsets of $S$, then

$$ N \left( S - \bigcup_{i=1}^{r} S_i \right) = N(S) - \sum_{1 \le i \le n} N(S_i) + \sum_{1 \le i < j \le n} N(S_i S_j) \\ - \sum_{1 \le i < j < k \le n} N(S_i S_j S_k) + \cdots + (-1)^n N(S_1 S_2 \cdots S_n), $$

where $S-T$ consists of those elements of $S$ which are not in $T$, and $S_iS_j, S_iS_jS_k$, etc. denote respectively $S_i \cap S_j, S_i \cap S_j \cap S_k$, etc.

**Theorem 8.3.** If $h(n) = \sum_{d|n} f(d)g(\frac{n}{d})$, let

$$ H(x) = \sum_{n \le x} h(n), \quad F(x) = \sum_{n \le x} f(n), \quad \text{and} \quad G(x) = \sum_{n \le x} g(n). $$

We then have

$$ H(x) = \sum_{n \le x} f(n)G(\frac{x}{n}) = \sum_{n \le x} g(n)F(\frac{x}{n}). $$

The proof of the theorem can be found in, for example, chapter 3 of Ref. [7].

## 9. BIASES IN TWIN PRIME DISTRIBUTION

Our analysis of the first 500 million prime numbers and corresponding about 30 million twin prime pairs ($\pi(x_0) = 5 \times 10^8$ and $\pi_2(x_0) = 29,981,546$) shows three different types of biases both in the distributions of the prime numbers and the twin prime pairs. For plotting different arithmetic functions, we take a data point after every 50 primes ($x_i = p_{50i}$) while presenting the results concerning prime numbers, and we take a data point after every 25 twin prime pairs ($x_i = \hat{p}_{25i}$) while presenting the results concerning twin primes. In the following we present our findings.

### 9.1. Type-I bias.
If $\pi_2(x; 4; 1)$ and $\pi_2(x; 4; 3)$ represent the number of prime pairs $\le x$ in the residue class $a = 1$ and $a = 3$ respectively, we find that $\pi_2(x; 4; 1) > \pi_2(x; 4; 3)$ for the most values of $x$. This can be seen from the Table 1. The bias is also evident from Figure 1 where we plot the functions $\delta_2(x; 4; 3) = \frac{\pi_2(x; 4; 3)}{\pi_2(x)}$ and $\bar{\Delta}_2(x; 4; 3, 1) = (\pi_2(x; 4; 3) - \pi_2(x; 4; 1)) \frac{\ln(x)}{10\sqrt{x}}$. In the definition of $\bar{\Delta}_2(x; 4; 3, 1)$, the factor 10 in the denominator is an overall scaling factor. Ideally, without bias, $\delta_2(x; 4; 3)$ should be 0.5 and $\bar{\Delta}_2(x; 4; 3, 1)$ should be zero. We also plot the corresponding functions for the prime numbers; we see that, while the prime numbers are biased towards the residue class $a = 3$, the twin prime pairs are in contrast biased towards the residue class $a = 1$.
<table><caption>TABLE 1. (Type-I bias) Here biases in case of primes and twin primes are respectively quantified by the functions $\Delta(x; 4; 3, 1) = \pi(x; 4; 3) - \pi(x; 4; 1)$ and $\bar{\Delta}_2(x; 4; 3, 1) = \pi_2(x; 4; 3) - \pi_2(x; 4; 1)$.</caption><thead><tr><th>x</th><th>π(x; 4; 3)</th><th>Δ(x; 4; 3, 1)</th><th>π<sub>2</sub>(x; 4; 3)</th><th>Δ<sub>2</sub>(x; 4; 3, 1)</th></tr></thead><tbody><tr><td>10<sup>7</sup></td><td>332398</td><td>218</td><td>29498</td><td>16</td></tr><tr><td>5 · 10<sup>7</sup></td><td>1500681</td><td>229</td><td>119330</td><td>-441</td></tr><tr><td>10<sup>8</sup></td><td>2880950</td><td>446</td><td>219893</td><td>-526</td></tr><tr><td>5 · 10<sup>8</sup></td><td>13179058</td><td>2250</td><td>919192</td><td>-1786</td></tr><tr><td>10<sup>9</sup></td><td>25424042</td><td>551</td><td>1711775</td><td>-956</td></tr><tr><td>5 · 10<sup>9</sup></td><td>117479241</td><td>4260</td><td>7308783</td><td>-600</td></tr><tr><td>10<sup>10</sup></td><td>227529235</td><td>5960</td><td>13706087</td><td>-505</td></tr></tbody></table>

<figure><img src="image_3.png" /><figcaption>FIGURE 1. (Type-I bias) Plots of the functions $\delta_2(x; 4; 3)$ and $\bar{\Delta}_2(x; 4; 3, 1)$. The corresponding plots for the prime numbers are also shown. The broken lines show expected results if there were no bias.</figcaption></figure>

Although the overall bias is seen to be towards the residue class $a = 1$ for the prime pairs, there is an interval in between where the class $a = 3$ is preferred. In fact we numerically find that upto about $x \approx 50,000$, the residue class $a = 1$ is preferred, then upto about $x \approx 10^7$, the residue class $a = 3$ is preferred. After this for a very long interval (we check upto about $x \approx 1.1 \times 10^{10}$), the residue class $a = 1$ is again preferred for the twin primes.

We also calculate the Brun's constant separately for the two residue classes. Let $B_2(x; 4; 1) = (\frac{1}{5} + \frac{1}{7}) + (\frac{1}{17} + \frac{1}{19}) + \cdots$ and $B_2(x; 4; 3) = (\frac{1}{3} + \frac{1}{5}) + (\frac{1}{11} + \frac{1}{13}) + \cdots$.
<figure><img src="image_4.png" /><figcaption>FIGURE 2. (Type-II bias) Plots of the functions $\delta_2(x; 4; 1|1)$ and $\delta_2(x; 4; 3|1)$ along with their counterparts for the prime numbers are shown here. Plots of the complementary functions, like $\delta_2(x; 4; 3|3) = 1 - \delta_2(x; 4; 3|1)$, are not provided. The broken line shows expected result if there were no bias.</figcaption></figure>

Here the first series involves the twin pairs whose first members are congruent to 1 (mod 4), similarly, the second series involves the twin primes whose first members are congruent to 3 (mod 4). In both cases we only consider the prime pairs in $[1, x]$. We find that $B_2(x_0; 4; 1) \approx 0.802233$ and $B_2(x_0; 4; 3) \approx 0.985735$, where $x_0$ is given by $\pi_2(x_0) = 29,981,546$. We note here that $B_2(x_0) = B_2(x_0; 4; 1) + B_2(x_0; 4; 3) \approx 1.787967$. The value of $B_2(x_0)$ is still somewhat far from its known value of $B_2 \approx 1.902161$; this is due to extremely slow convergence of the series of the reciprocals of twin primes. We find that $B_2(x_0; 4; 3)$ keeps a lead over $B_2(x_0; 4; 1)$ from the beginning (the first twin pair belongs to class $a = 3$). Since $B_2 - B_2(x_0) \approx 0.114194$ and $B_2(x_0; 4; 3) - B_2(x_0; 4; 1) = 0.183502$, it can be concluded that, irrespective of how large $x$ is, $B_2(x; 4; 3)$ will always be larger than $B_2(x; 4; 1)$. In future study, it will be interesting to find out whether $\lim_{x \to \infty} B_2(x; 4; 1)$ and $\lim_{x \to \infty} B_2(x; 4; 3)$ exist and, if so, what the corresponding limits are.

## 9.2. Type-II bias.
A second type of bias can be found if we consider the consecutive twin prime pairs. Our numerical results show that after a prime pair of certain residue class, it is more probable to find the next prime pair to be from the different residue class. To quantify this bias, we define the following functions: $\delta_2(x; 4; 1|1) := \frac{\pi_2(x; 4; 1|1)}{\pi_2(x; 4; 1)}$ and $\delta_2(x; 4; 1|3) := \frac{\pi_2(x; 4; 1|3)}{\pi_2(x; 4; 1)}$. Here $\pi_2(x; 4; a_i|aj)$ denotes the number of twin prime pairs ($\le x$) belonging to the residue class $a_i$ provided that their next pairs belong to the class $aj$. It may be noted that $\delta_2(x; 4; 1|1) + \delta_2(x; 4; 1|3) = 1$. Functions $\delta_2(x; 4; 3|1)$ and $\delta_2(x; 4; 3|3)$ are defined similarly. The plots of function $\delta_2(x; 4; 1|1)$ and $\delta_2(x; 4; 3|1)$ can be found in Figure 2. The corresponding plots for the prime numbers are also shown in the figure. If we consider the twin prime pairs to be completely uncorrelated, the values of
<table><caption>TABLE 2. (Type-II bias) Variation of functions $\delta(x; 4; a_i|a_j)$ and $\delta_2(x; 4; a_i|a_j)$ are very slow and smooth. Values of the functions are rounded off to the four decimal places.</caption><thead><tr><th>x</th><th>δ(x; 4; 1|1)</th><th>δ(x; 4; 3|1)</th><th>δ<sub>2</sub>(x; 4; 1|1)</th><th>δ<sub>2</sub>(x; 4; 3|1)</th></tr></thead><tbody><tr><td>10<sup>7</sup></td><td>0.4350</td><td>0.5647</td><td>0.4769</td><td>0.5228</td></tr><tr><td>10<sup>8</sup></td><td>0.4434</td><td>0.5565</td><td>0.4815</td><td>0.5198</td></tr><tr><td>10<sup>9</sup></td><td>0.4489</td><td>0.5511</td><td>0.4836</td><td>0.5166</td></tr><tr><td>10<sup>10</sup></td><td>0.4534</td><td>0.5466</td><td>0.4864</td><td>0.5136</td></tr></tbody></table>

these functions should be 0.5. But we see that, for example, $\delta_2(x; 4; 1|3) > 0.5 > \delta_2(x; 4; 1|1)$ for all values of $x$ that we investigated. Exactly same behavior is seen in case of prime numbers, although the bias is more here. The bias in consecutive primes was investigated earlier in Ref. [5].

We here would like to point out that the functions like $\delta_2(x; 4; 1|1)$ and $\delta_2(x; 4; 3|1)$ are quite regular and smooth compared to a function like $\delta_2(x; 4, 3)$ or $\bar{\Delta}_2(x; 4, 3, 1)$. The values of the functions $\delta_2(x; 4; 1|1)$ and $\delta_2(x; 4; 3|1)$ for some values of $x$ can be found in Table 2.

Although $\delta_2(x; 4; a_i|a_j)$ varies very slowly, we expect all these functions to approach 0.5 as $x$ goes to infinity. Assuming that there are infinite number of twin prime pairs, we propose the following conjecture.

**Conjecture 9.1.** For any two residue classes $a_i$ and $a_j$, we have $\delta_2(x; 4; a_i|a_j) = 0.5$ as $x \to \infty$.

9.3. **Type-III bias.** A third type of bias can be found if we study the gap between the first members of consecutive twin prime pairs. To quantify the bias, we define the following functions: $\delta_2^+(x) := \frac{\pi_2^+(x)}{\pi_2(x)}$, where $\pi_2^+(x)$ is the number of prime pairs ($\le x$) for each of which the following twin prime gap plus 1 is a prime number, i.e., $\pi_2^+(x) = \#\{\hat{p}_n \le x \mid (\hat{p}_{n+1} - \hat{p}_n + 1) \text{ is a prime}\}$. Similarly, the function $\delta_2^-(x)$ is

<table><caption>TABLE 3. (Type-III bias) Variation of functions $\delta^+(x)$ and $\delta_2^+(x)$ are very slow and smooth. Values of the functions are rounded off to the four decimal places.</caption><thead><tr><th>x</th><th>δ<sup>+</sup>(x)</th><th>δ<sup>-</sup>(x)</th><th>δ<sub>2</sub><sup>+</sup>(x)</th><th>δ<sub>2</sub><sup>-</sup>(x)</th></tr></thead><tbody><tr><td>10<sup>7</sup></td><td>0.7418</td><td>0.6739</td><td>0.6673</td><td>0.7103</td></tr><tr><td>10<sup>8</sup></td><td>0.7203</td><td>0.6664</td><td>0.6401</td><td>0.6803</td></tr><tr><td>10<sup>9</sup></td><td>0.7026</td><td>0.6585</td><td>0.6186</td><td>0.6560</td></tr><tr><td>10<sup>10</sup></td><td>0.6875</td><td>0.6506</td><td>0.6001</td><td>0.6349</td></tr></tbody></table>

defined to quantify the bias in the twin prime gap minus 1. If the prime pairs were distributed in a completely random manner, both $\delta_2^+(x)$ would have been less than 0.5 since we have more odd composites than the primes. But what we find is that
<figure><img src="image_5.png" /><figcaption>FIGURE 3. (Type-III bias) Plots of the functions $\delta_2^+(x)$ and $\delta_2^-(x)$. The corresponding results for the prime numbers are also provided.</figcaption></figure>

$\delta_2^-(x) > \delta_2^+(x) > 0.5$ for all the values of $x$ that we investigated. Exactly similar bias is seen for the prime numbers, but in this case, interestingly, $\delta^+(x) > \delta^-(x) > 0.5$. The values of the functions $\delta_2^\pm(x)$ for some values of $x$ can be found in Table 3. The results related to this particular type of bias can be seen in Fig. 3.

Although $\delta^\pm(x)$ and $\delta_2^\pm(x)$ change very slowly, we expect all these functions to eventually go to 0 since the number of odd composite numbers grow faster than the prime numbers. Assuming infinitude of twin primes, we propose the following conjecture for this type of bias.

**Conjecture 9.2.** As $x \to \infty$, $\delta^+(x) = \delta^-(x) = 0$ and $\delta_2^+(x) = \delta_2^-(x) = 0$.

REFERENCES

1. Jing-run Chen, On the representation of a larger even integer as the sum of a prime and the product of at most two primes, *Scientia Sinicia XVI* (1973), 157-176.

2. Y. Zhang, Bounded gaps between primes, *Ann. of Math. 179* (2014), 1121-1174. http://dx.doi.org/10.4007/annals.2014.179.3.7.

3. A. Granville and G. Martin, Prime number races, *Am. Math. Mon.* **113** (2006), 1-33. https://doi.org/10.2307/27641834.

4. M. Rubinstein and P. Sarnak, Chebyshev's Bias, *Exp. Math.* **3** (1994), 173-197. https://projecteuclid.org/euclid.em/1048515870.

5. R. J. L. Oliver and K. Soundararajan, Unexpected biases in the distribution of consecutive primes, *Proc. Nat. Acad. Sci.* **113** (2016), E4446-E4454. https://doi.org/10.1073/pnas.1605366113.

6. B. Green and T. Tao, The primes contain arbitrarily long arithmetic progressions, *Ann. of Math.* **167** (2008), 481-547. https://doi.org/10.4007/annals.2008.167.481.

7. T. M. Apostol, Introduction to Analytic Number Theory, Springer, New York, 1976.

8. S. W. Golomb, The twin prime constant, *Am. Math. Mon* **67** (1960), 767-769. https://doi.org/10.2307/2308654.