\section{The range below the sieve threshold}\label{sec:middle} Let $\sigma_{11} = \frac12 + \frac13 + \frac15 + \frac17 + \frac1{11}$, and for $X \ge 10372$ put \[ S'(X) := \log\log X + B + d(X) - \sigma_{11}, \qquad P_{13}(k) := \sum_{p \ge 13} p^{-k}, \qquad C_{11}(z) := \sum_{k \ge 2} \frac{P_{13}(k)}{k} z^k , \] \begin{gather*} G_0 := 135 \Bigl( \frac{1}{480} - \frac{1}{840 \log(4 \cdot 10^{18} - 2)} \Bigr) = 0.27749787\ldots, \qquad A_a := \sum_{p \ge 13} \frac{a \log p}{p^a} \quad (a \ge 2),\\ L_{\rm low} := \log(4 \cdot 10^{18}), \qquad R^*_j := [z^j] \exp\bigl( z S'(X) + C_{11}(z) \bigr) \quad (j \ge 0). \end{gather*} Here $[z^j]$ denotes the coefficient of $z^j$ in a power series. \begin{lemma}[Exact coefficients]\label{lem:Rstar} For $X \ge 10372$, $N \le X$ and $j \ge 0$, $\displaystyle \sum_{\substack{m \le N,\ (m, 2310) = 1\\ \Omega(m) = j}} \frac{1}{m} \le R^*_j$. \end{lemma} \begin{proof} The $m$ in the sum are products of primes in $[13, N]$, so the sum is at most $[z^j] \prod_{13 \le p \le N} (1 - z/p)^{-1}$, the coefficient of a power series with nonnegative coefficients. Its logarithm is $\sum_{k \ge 1} b_k z^k$ with $b_k = k^{-1}\sum_{13 \le p \le N} p^{-k} \ge 0$. Here $b_1 \le \sum_{p \le X} 1/p - \sigma_{11} \le S'(X)$ by (I3), since the prime sum increases with $N$ and $X \ge 10372$; and $b_k \le P_{13}(k)/k$ for $k \ge 2$. The coefficients of $\exp(\sum b_k z^k)$ are polynomials with nonnegative coefficients in the $b_k$, so they do not decrease when each $b_k$ is replaced by an upper bound. \end{proof} \begin{remark} For any $0 < \tau < 13$ the coefficient $R^*_j$ is at most $\tau^{-j}\exp(\tau S'(X) + C_{11}(\tau))$, a single term of a nonnegative series. This is Rankin's bound \cite{Rankin}. Keeping the coefficient can give a sharper estimate; no quantitative estimate for the ratio of these two bounds is used below. The coefficients are computed exactly from the recurrence $n R^*_n = S'(X) R^*_{n-1} + \sum_{k=2}^{n} P_{13}(k) R^*_{n-k}$, $R^*_0 = 1$, whose terms are nonnegative. \end{remark} \begin{lemma}\label{lem:C3} Let $X \ge 4 \cdot 10^{18}$, $L_X = \log X$, $k_{\max} = \lfloor L_X / \log 13 \rfloor$, let $0 < \delta < 1$ with $\delta L_{\rm low} \ge 1$, and let $K \ge 1$ be an integer with \begin{equation}\label{eq:C3} L_{\rm low}\, e^{-\delta L_{\rm low}} + \frac{1}{1 - \delta} \sum_{k = K+1}^{k_{\max}} \Bigl( c_\theta R^*_{k-1} + \sum_{a=2}^{k} A_a R^*_{k-a} \Bigr) \ <\ G_0 (1 - 10^{-18}) - 10^{-18}. \end{equation} Then every even $N$ with $4 \cdot 10^{18} \le N \le X$ can be written as $N = p + \eta$ with $p$ an odd prime, $\eta \ge 3$ odd, $(\eta, 1155) = 1$ and $\Omega(\eta) \le K$. \end{lemma} \begin{proof} Fix $N$, put $y = N - 2$ and $L = \log N$. \emph{Good primes.} Let $\cR$ be the set of residues $b \bmod 1155$ with $(b, 1155) = 1$ and $(N - b, 1155) = 1$. For each prime $q \mid 1155$ the condition allows $q - 1$ residues modulo $q$ if $q \mid N$ and $q - 2$ otherwise, so $|\cR| \ge 1 \cdot 3 \cdot 5 \cdot 9 = 135$. By (I2) with $q = 1155$ and $x = y \ge 8 \cdot 10^9$, $\theta(y; 1155, b) > y/480 - y/(840 \log y)$ for each $b \in \cR$. Summing and discarding the prime $2$, \[ \mathcal G := \sum_{\substack{p \le y,\ p \text{ odd}\\ p \bmod 1155 \in \cR}} \log p\ >\ G_0\, y - \log 2 . \] Every such $p$ has $(N - p, 1155) = 1$ and $N - p$ odd. \emph{Bad primes.} If $p$ is counted in $\mathcal G$ and $\Omega(N - p) > K$, then $n = N - p$ lies in $E := \{ n \le N : (n, 2310) = 1,\ \Omega(n) > K \}$, and distinct $p$ give distinct $n$. Hence the bad part of $\mathcal G$ is at most $L \cdot |E|$. At most $N^{1-\delta}$ elements of $E$ are at most $N^{1-\delta}$; they contribute at most $L N^{1-\delta} = N L e^{-\delta L} \le N L_{\rm low} e^{-\delta L_{\rm low}}$, since $t \mapsto t e^{-\delta t}$ decreases for $t \ge 1/\delta$ and $L \ge L_{\rm low} \ge 1/\delta$. An element $n > N^{1-\delta}$ has $\log n > (1 - \delta) L$; so with $S_k := \sum \log n$ over $n \le N$, $(n, 2310) = 1$, $\Omega(n) = k$, the remaining contribution is at most $(1 - \delta)^{-1} \sum_{k > K} S_k$, where $k \le k_{\max}$ since $13^{\Omega(n)} \le n$. By Chebyshev's identity $\log n = \sum_{p^a \parallel n} a \log p$, \[ S_k \le \sum_{a \ge 1} \sum_{p \ge 13} a \log p \cdot \#\bigl\{ n' \le N/p^a : (n', 2310) = 1,\ \Omega(n') = k - a \bigr\}. \] For $a = 1$, exchanging the sums gives $\sum_{n'} \theta(N/n') \le c_\theta N \sum_{n'} 1/n'$ over $n' \le N$ coprime to $2310$ with $\Omega(n') = k - 1$, by (I3); this is at most $c_\theta N R^*_{k-1}$ by Lemma~\ref{lem:Rstar}. For $a \ge 2$, the number of admissible $n'$ is at most $(N/p^a) \sum 1/n'$ over the same kind of $n'$ with $\Omega(n') = k - a$, so the contribution is at most $N A_a R^*_{k-a}$. \emph{Conclusion.} The bad part is at most $N$ times the left side of \eqref{eq:C3}, hence less than $N\bigl(G_0 (1 - 10^{-18}) - 10^{-18}\bigr) \le G_0 y - \log 2$, since $y \ge N(1 - 5 \cdot 10^{-19})$ and $\log 2 < 10^{-18} N$ for $N \ge 4 \cdot 10^{18}$. So some odd $p \le N - 2$ counted in $\mathcal G$ has $\Omega(N - p) \le K$. \end{proof} \begin{lemma}\label{lem:C3num} With $\delta = 1/5$, condition \eqref{eq:C3} holds for $(X, K) = (e^{1800}, 18)$, $(e^{350}, 14)$ and $(e^{62}, 9)$: the left side is $< 0.209801$, $< 0.149761$ and $< 0.241386$ respectively, against $G_0(1 - 10^{-18}) - 10^{-18} > 0.2774978$. For $(X, K) = (e^{1800}, 17)$ the left side exceeds $0.5646$. \end{lemma} \begin{proof} Interval computation, \S\ref{sec:numerics}. The last statement is a lower bound for the left side at $\delta = 1/5$; it says nothing about other values of $\delta$. \end{proof} \subsection{Pre-sieving the integers to be excluded} Put $Y := 8 \cdot 10^9$ and $\eps_Y := 480/(840 \log Y)$. \begin{lemma}\label{lem:C4} Let $4 \cdot 10^{18} \le Y_i \le X$ with $L_i := \log Y_i > \log Y$, let $\delta, \delta_2 > 0$ with $\delta + \delta_2 < 1$, $\delta L_i \ge 1$ and $\delta_2 L_i \ge 2$, let $K \ge 1$ be an integer and $k_{\max} := \lfloor \log X/\log 13 \rfloor$, and put \[ W_k := \frac{c_\theta (1 + \log Y) R^*_{k-2} + \sum_{a=2}^{k-1} A_a R^*_{k-1-a}}{L_i - \log Y} . \] If \begin{multline}\label{eq:C4} \frac{480}{135}\Bigl[ L_i e^{-\delta L_i} + 2\zeta(3/2) L_i e^{-\delta_2 L_i/2} + \frac{c_\theta}{1 - \delta - \delta_2} \sum_{k=K+1}^{k_{\max}} W_k \Bigr] + \frac{1 + \eps_Y}{1 - \delta - \delta_2} \sum_{k=K+1}^{k_{\max}} R^*_{k-1}\\ <\ \Bigl(1 - \frac{480}{840 \log(4 \cdot 10^{18} - 2)}\Bigr)(1 - 10^{-18}) - \frac{480}{135} \cdot 10^{-18}, \end{multline} then every even $N$ with $Y_i \le N \le X$ can be written as $N = p + \eta$ with $p$ an odd prime, $\eta \ge 3$ odd, $(\eta, 1155) = 1$ and $\Omega(\eta) \le K$. \end{lemma} \begin{proof} Fix $N$, $L := \log N \ge L_i$ and $y := N - 2$, and let $\cR$ be as in the proof of Lemma~\ref{lem:C3}. The good primes are the odd primes $P \le y$ with $P \bmod 1155 \in \cR$, and $\mathcal G := \sum_{\rm good} \log P > |\cR| (y/480 - y/(840 \log y)) - \log 2$ by (I2), the term $\log 2$ allowing us to exclude $P = 2$. Every good complement $N - P$ is odd, at least $3$ and coprime to $1155$. The bad ones have $n := N - P$ with $\Omega(n) \ge K + 1$; these $n$ are distinct, and the bad part of $\mathcal G$ is at most $L \cdot \# E'$, where $E' := \{ n = N - P : P \text{ good},\ \Omega(n) \ge K + 1 \}$. We split $E'$ into three parts. (i) $n \le N^{1-\delta}$: at most $N^{1-\delta}$ elements. (ii) $n > N^{1-\delta}$ whose squarefull part $s(n)$ exceeds $N^{\delta_2}$: at most $N \sum_{s \text{ squarefull},\, s > N^{\delta_2}} 1/s \le 2\zeta(3/2) N^{1 - \delta_2/2}$ elements. Indeed every squarefull $s$ is $u^2 v^3$ with $v$ squarefree, and $\sum_{u > A} u^{-2} \le 2/A$ for every $A > 0$ (for $A < 1$ use $\zeta(2) < 2 < 2/A$); hence $\sum_{s > T} 1/s \le \sum_v v^{-3} \cdot 2 \sqrt{v^3/T} \le 2\zeta(3/2) T^{-1/2}$. (iii) $n > N^{1-\delta}$ with $s(n) \le N^{\delta_2}$. Write $n = s r$ with $r$ squarefree and coprime to $s$; then $\log r > (1 - \delta - \delta_2) L$. So the number of such $n$ with $\Omega(n) = k$ is at most $\sum \log r/((1 - \delta - \delta_2) L)$, and $\sum \log r$ counts each prime $p$ of $r$ once: $\sum \log r = \sum_{(p, n')} \log p$ over the factorisations $n = p n'$ with $p \parallel n$ and $p \mid r$. For fixed $n'$, which has $\Omega(n') = k - 1$, is coprime to $2310$ and determines the decomposition, the prime $p$ satisfies $p n' = n \equiv N - b \pmod{1155}$ for some $b \in \cR$, so $p$ lies in the $|\cR|$ reduced classes $(N - b)\bar{n}' \bmod 1155$. If $N/n' \ge Y$, (I2) gives \[ \sum_{\substack{p \le N/n'\\ p \text{ in those classes}}} \log p \ \le\ |\cR| \frac{N/n'}{480} \Bigl( 1 + \frac{480}{840 \log(N/n')} \Bigr) \ \le\ \frac{|\cR|}{480} (1 + \eps_Y) \frac{N}{n'} . \] If $n' > N/Y$, the sum is at most $\theta(N/n') \le c_\theta N/n'$ by (I3). Hence the part (iii) with $\Omega(n) = k$ contributes at most $N \bigl[ (|\cR|/480)(1 + \eps_Y) R^*_{k-1} + c_\theta \mathcal W_k \bigr]/((1 - \delta - \delta_2)L)$ elements, where $\mathcal W_k := \sum 1/n'$ over $N/Y < n' \le N$ with $\Omega(n') = k - 1$ and $(n', 2310) = 1$. \emph{The window.} For $n' > N/Y$ we have $\log n' > L - \log Y \ge L_i - \log Y$, so $\mathcal W_k \le (L_i - \log Y)^{-1} \sum \log n'/n'$ over the same $n'$. By Chebyshev's identity again, writing $n' = p^a m$ with $p^a \parallel n'$: for $a = 1$ the prime $p$ runs over $(N/(Ym), N/m]$, and partial summation with $\theta(t) \le c_\theta t$ gives $\sum_{A < p \le B} \log p/p \le \theta(B)/B + \int_A^B \theta(t) t^{-2}\, dt \le c_\theta(1 + \log(B/A))$, so this part is at most $c_\theta (1 + \log Y) R^*_{k-2}$; the terms with $a \ge 2$ contribute at most $\sum_{a \ge 2} A_a R^*_{k-1-a}$. So $\mathcal W_k \le W_k$. \emph{Assembly.} The bad part of $\mathcal G$ is at most \[ L N^{1-\delta} + 2\zeta(3/2) L N^{1 - \delta_2/2} + \frac{N}{1 - \delta - \delta_2} \sum_{k=K+1}^{k_{\max}} \Bigl[ \frac{|\cR|}{480}(1 + \eps_Y) R^*_{k-1} + c_\theta W_k \Bigr], \] and $L e^{-\delta L} \le L_i e^{-\delta L_i}$, $L e^{-\delta_2 L/2} \le L_i e^{-\delta_2 L_i/2}$, since these decrease for $L \ge 1/\delta$ and $L \ge 2/\delta_2$. Divide the upper bound for the bad part and the lower bound for $\mathcal G$ by $N\kappa$, where $\kappa := |\cR|/480 \ge 135/480$. The terms that do not carry $|\cR|$ acquire a factor $1/\kappa \le 480/135$, and the factor $|\cR|/480$ of the main term cancels. The good side becomes $(1 - 480/(840 \log y))(y/N) - (\log 2)/(N\kappa)$, which is at least the right side of \eqref{eq:C4} since $y/N \ge 1 - 5 \cdot 10^{-19}$ and $\log 2 < 10^{-18} N$. So \eqref{eq:C4} implies that some good $P$ has $\Omega(N - P) \le K$. \end{proof} \begin{remark} The gain over Lemma~\ref{lem:C3} is the factor $480/|\cR| \le 480/135$ in the main term: the integers to be excluded are confined to the residue classes of the primes that produce them. \end{remark} \begin{lemma}\label{lem:C4num} With $Y_i = e^{1800}$, $X = X_2' = \exp(2736.86)$, $\delta = \delta_2 = 0.02$ and $K = 18$, the left side of \eqref{eq:C4} is $< 0.406804$, against a right side $> 0.986659$. \end{lemma} \begin{proof} Interval computation, \S\ref{sec:numerics}. \end{proof}