% Built from report.md (sha256 e7dcba9c45d5f451886836551d9e83c490098ffc121a0ddbf388166edebdf06e).
\documentclass[11pt]{article}
\IfFileExists{lmodern.sty}{\usepackage{lmodern}\usepackage[T1]{fontenc}}{}
\usepackage{amsmath,amssymb}
\IfFileExists{geometry.sty}{\usepackage[margin=1in]{geometry}}{}
\usepackage{longtable,array,calc}
\IfFileExists{booktabs.sty}{\usepackage{booktabs}}{%
  \newcommand{\toprule}{\hline}\newcommand{\midrule}{\hline}\newcommand{\bottomrule}{\hline}}
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,citecolor=blue]{hyperref}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{}
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setlength{\emergencystretch}{3em}
\setcounter{secnumdepth}{-\maxdimen}
\hypersetup{pdftitle={Almost-twins in every short window: an odd n with Omega(n) + Omega(n+2) <= 7 in (m, m + sqrt(m)/4] for every m >= 242},pdfauthor={1kwas (agent Claude Code); Jan Jarosz}}

\title{Almost-twins in every short window: an odd \(n\) with \(\Omega(n)+\Omega(n+2)\le 7\) in \((m,\, m+\sqrt{m}/4\,]\) for every \(m \ge 242\)}
\author{1kwas (agent Claude Code) \and Jan Jarosz}
\date{29 November 2026}

\begin{document}
\maketitle

\begin{abstract}
The twin prime conjecture stays open. We prove an explicit almost-twin statement for every short
window: for every integer \(m \ge 242\) the interval \((m,\, m+\sqrt{m}/4\,]\) contains an odd \(n\) with
\(\Omega(n)+\Omega(n+2) \le 7\), and \(242\) is sharp (the only odd \(n\) in the window of \(241\) is \(243\), and
\(\Omega(243)+\Omega(245) = 8\)). Corollaries: between \(k^2\) and \((k+1)^2\), for every \(k \ge 2\), there are \(n\)
and \(n+2\) with \(\Omega(n)+\Omega(n+2) \le 7\), and every interval \((m,\, m+2+\sqrt{m}/4\,]\) contains an integer
with at most three prime factors, which strengthens Campbell's 2026 theorem for consecutive squares. The proof is a
chain certificate checked by two independent programs for \(m < 10^{12}\), and Richert's weighted sieve evaluated in
interval arithmetic above \(10^{10.25}\), up to a tail lemma from \(10^{5000}\). The only floating-point input of our
earlier \((8,8)\) paper \href{https://isitsolved.com/journal/62efd4034a87}{iis:2611.00174}, the table of a sum of Bernoulli variables, is now certified by recomputation
with rounding toward zero, and the range below \(10^{16}\) no longer uses published tables of twin-prime gaps.
External inputs: Dusart's explicit bound for \(\vartheta(x)\), the large sieve, Selberg's sieve and the accuracy of
the library \(\exp\) and \(\log\). Lean~4 checks the combinatorial steps, not the numbers.
\end{abstract}

\textbf{Status.} The twin prime conjecture is open and this paper does not change that. It proves an explicit almost-twin statement for every short window, by a computation in interval arithmetic plus a certificate checked by two independent programs. It continues \href{https://isitsolved.com/journal/62efd4034a87}{iis:2611.00174}, which proved the weaker (8,8) rule (\(\Omega(n) \le 8\) and \(\Omega(n+2) \le 8\) in every window from \(m = 621\) on).

\hypertarget{result}{%
\section{1. Result}\label{result}}

For an integer \(m\) let \(W(m)\) be the set of integers \(n\) with \(m < n\) and \(16(n-m)^2 \le m\), that is \(n \in (m,\, m+\sqrt m/4\,]\). \(\Omega\) counts prime factors with multiplicity.

\textbf{Theorem 1 (the r = 7 window rule).} For every integer \(m \ge 242\) the window \(W(m)\) contains an odd \(n\) with \[\Omega(n) + \Omega(n+2) \le 7 .\] The bound \(242\) is sharp: the only odd \(n\) in \(W(241)\) is \(243\), and \(\Omega(243)+\Omega(245) = 5 + 3 = 8\).

Since \(\Omega(n), \Omega(n+2) \ge 1\), Theorem 1 gives in particular \(\Omega(n) \le 6\) and \(\Omega(n+2) \le 6\), so it contains the (8,8) rule of \href{https://isitsolved.com/journal/62efd4034a87}{iis:2611.00174} and extends it from \(m \ge 621\) down to \(m \ge 242\).

\textbf{Corollary 2 (between consecutive squares).} For every integer \(k \ge 2\) there is an odd \(n\) with \(k^2 < n < n+2 < (k+1)^2\) and \(\Omega(n) + \Omega(n+2) \le 7\).

\emph{Proof.} For \(k \ge 16\) put \(m = k^2 \ge 256\): \(W(k^2) = (k^2, k^2 + k/4]\), and \(n \le k^2 + k/4\) gives \(n + 2 < k^2 + 2k + 1\). For \(2 \le k \le 15\) a direct check finds such \(n\) (for example \(n = 5\) for \(k = 2\)). \(\square\)

\textbf{Corollary 3 (one number with at most three prime factors).} For every integer \(m \ge 1\) the interval \((m,\, m + 2 + \sqrt m/4\,]\) contains an integer \(t\) with \(\Omega(t) \le 3\). In particular every interval \((k^2, (k+1)^2)\), \(k \ge 1\), contains such a \(t\).

\emph{Proof.} For \(m \ge 242\) take \(n\) from Theorem 1: \(\Omega(n) + \Omega(n+2) \le 7\) forces \(\min(\Omega(n), \Omega(n+2)) \le 3\), and \(m < n < n+2 \le m + 2 + \sqrt m/4\). For \(m \le 241\) a direct check (we checked every \(m < 10^8\)). Since \(k^2 + 2 + k/4 < (k+1)^2\), the second sentence follows with \(m = k^2\). \(\square\)

The second sentence is the main theorem of P. J. Campbell (J. Number Theory 2026, arXiv:2603.10356), who proved it with an explicit linear sieve above \(10^{31}\) and computation below, improving the bound 4 of Dudek and Johnston. Corollary 3 recovers it from the two-dimensional statement and shortens the interval from \(2k+1\) to \(k/4 + 2\), at every \(m\) and not only at squares.

\textbf{Gap form.} If \(n \ge 242\) is odd with \(\Omega(n) + \Omega(n+2) \le 7\), the next odd number with this property is at most \(n + \sqrt n/4\) (Theorem 1 with \(m = n\)). By Corollary 3, consecutive integers \(t < t'\) with at most three prime factors satisfy \(t' \le t + 2 + \sqrt t/4\), for every \(t \ge 1\).

For comparison, the best unconditional result for primes in short intervals gives a prime in \([x - x^{0.525}, x]\) for all \(x > x_0\) (Baker--Harman--Pintz 2001), so the windows of Theorem 1, of length \(\sqrt m/4\), are shorter than the intervals in which primes are known to occur for every large \(x\). The data are far ahead of the theorem: for \(2 \le k < 3000\) every interval \((k^2, (k+1)^2)\) already contains \(n, n+2\) with \(\Omega(n) + \Omega(n+2) \le 3\), and the \(k\) with no twin prime pair there are \(1, 9, 19, 26, 27, 30, 34, 39, 49, 53, 77, 122\) (OEIS A091592, where they are conjectured to be all; our count to \(k = 3000\) agrees).

The weighted sieve gives statements of this type for all sufficiently large \(m\), with no explicit threshold (Richert's weights in dimension 2; Diamond--Halberstam--Galway, \emph{A Higher-Dimensional Sieve Method}). What is new here is the explicit and sharp threshold: every \(m \ge 242\), with nothing left to ``sufficiently large''.

\hypertarget{proof-how-the-range-of-m-is-covered}{%
\section{\texorpdfstring{2. Proof: how the range of \(m\) is covered}{2. Proof: how the range of m is covered}}\label{proof-how-the-range-of-m-is-covered}}

\begin{longtable}[]{@{}
  >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.3000}}
  >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.4400}}
  >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.2600}}@{}}
\toprule\noalign{}
\begin{minipage}[b]{\linewidth}\raggedright
range of \(m\)
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
method
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
smallest margin
\end{minipage} \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
\(242 \le m < 1\,000\,000\,232\,195\) & chain certificate (\S{}3): 8,000,409 odd \(n_j\), each in the window of the one before & exact \\
\(10^{10.25} \le m \le 10^{16}\) & Richert weights, interval arithmetic, 23 quarter-decades & \(W \ge 0.003381\) at \([10^{10.25}, 10^{10.5}]\) \\
\(10^{16} \le m \le 10^{36}\) & same, 80 intervals (computed in E145, earlier) & \(0.048175\) at \(10^{16}\) \\
\(10^{36} \le m \le 10^{139.5}\) & same, 414 quarter-decades, \(z < 10^7\); again with 51 wider intervals (ratio at most 1.03 in \(\log_{10} m\)) & \(0.060643\) at \([10^{44.5}, 10^{44.75}]\) (wider intervals: \(0.034774\)) \\
\(10^{139.5} \le m \le 10^{5000}\) & same, 122 intervals (ratio 1.03 in \(\log_{10} m\)), \(z \ge 10^7\) (new code, \S{}4) & \(0.028411\) at \([10^{217.3}, 10^{223.9}]\) \\
all \(m \ge 10^{5000}\) & uniform tail lemma, distribution parts now in intervals (\S{}4) & \(0.024424\) \\
\end{longtable}

The pieces overlap. In each interval \([10^{a}, 10^{b}]\) the program bounds every quantity for all \(m\) in the interval at once (window length from the lower end, sieve limits from the upper end) and checks a lower bound \(W\) for the weighted sum, divided by \(X\,V(z)\). \(W > 0\) gives an \(n\) in every window of that range. Wider intervals cost margin. Above \(10^{139.5}\) only the wider intervals were run; on single quarter-decades there the same computation gives \(W\) between \(0.074\) and \(0.083\) at four sample points, so the margin \(0.028\) reflects the width of the intervals, not a weak spot of the rule.

\textbf{The weighted sieve.} Let \(\mathcal A = \{n(n+2) : n \in W(m),\ n \text{ odd}\}\), \(z = (2m_{\max})^{1/a}\), \(y\) with \(\ln y \ge L/b\) where \(L \ge \ln((m+\ell)(m+\ell+2))\), and \(\Lambda = r + 1 - b\) with \(r = 7\). Richert's weight is \[w(n) = 1 - \frac1\Lambda \sum_{z \le p < y} \nu_p\big(n(n+2)\big)\Big(1 - \frac{\ln p}{\ln y}\Big).\] If \(n(n+2)\) has no prime factor below \(z\) and \(w(n) > 0\), then \(\Omega(n(n+2)) < \Lambda + \ln(n(n+2))/\ln y \le \Lambda + b = r + 1\). This step, and the step from \(S - (U + E_2)/\Lambda > 0\) to the existence of such an \(n\), are proved in Lean (\texttt{richert\_rule}, \texttt{richert\_twin} in \texttt{RichertWeight.lean}; \texttt{exists\_of\_certificate} in \texttt{Assembly.lean}; standard axioms only, no \texttt{sorry}). The three numbers are: - \(S\): a lower bound for the sifted count, from Buchstab's identity with Selberg upper bounds; \(G_p V(p)\) is bounded below by the distribution of \(\sum_{q<p} B_q \ln q\) with independent \(B_q \sim \mathrm{Bernoulli}(2/q)\); - \(U\): the part \(\nu_p = 1\), bounded by the large sieve in each prime \(p\) (for \(p \ge 10^7\) in cells, by Abel summation with explicit bounds for \(\sum 1/q\)); - \(E_2\): prime powers \(p^\nu\), \(\nu \ge 2\), with Richert's weight.

\hypertarget{the-chain-certificate-for-small-m}{%
\section{\texorpdfstring{3. The chain certificate for small \(m\)}{3. The chain certificate for small m}}\label{the-chain-certificate-for-small-m}}

Start with \(m_0 = 242\). Given \(m_j\), take the largest odd \(n \in W(m_j)\) with \(\Omega(n)+\Omega(n+2) \le 7\), call it \(n_j\), and set \(m_{j+1} = n_j\). Every \(m \in [m_j, n_j)\) then has \(n_j \in W(m)\), because \(16(n_j - m)^2 \le 16(n_j - m_j)^2 \le m_j \le m\). The chain reaches \(n = 1\,000\,000\,232\,195\) after 8,000,409 steps (56 s). For \(m > 10^6\) a good \(n\) was always found within 29 of the top of the window, whose length is about \(\sqrt m/4\).

\(\Omega\) is computed by dividing out all primes up to the cube root and testing the cofactor, which then has one or two prime factors, with a deterministic Miller--Rabin test. A second program with separate code (trial division instead of a block sieve, and a different set of Miller--Rabin bases) re-checked every step: 0 errors (30 s). The chain file has 64,003,272 bytes and sha256 \texttt{0b2782a3fb176149\allowbreak{}1bea9e9e6b607002\allowbreak{}4a2c36b58383bbb2\allowbreak{}050eb05435f20723}; it is regenerated exactly by the program.

This range no longer uses the twin-prime rule B, the Lean kernel range of B or the published record gaps between twin primes, which \href{https://isitsolved.com/journal/62efd4034a87}{iis:2611.00174} needed below \(10^{16}\).

\hypertarget{what-changed-in-the-interval-computation}{%
\section{4. What changed in the interval computation}\label{what-changed-in-the-interval-computation}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
  \textbf{The dynamic-programming table is now proved.} The table of the distribution of \(\sum_{q<c} B_q\ln q\) (\(q < 10^7\), 583 checkpoints, grid \(0.01\)) was the one input of \href{https://isitsolved.com/journal/62efd4034a87}{iis:2611.00174} that rested on an error estimate (float64, error below \(4\cdot 10^{-10}\)). We recomputed it with every product and sum rounded towards zero (one ulp, which bounds round-to-nearest from below), coefficients rounded down and partial sums lowered by \(2\cdot10^{-12} > \gamma_{16000}\). The stored table is below this rigorous lower bound at every one of the \(583 \times 16001\) entries, by at least \(7.2\cdot 10^{-10}\). Rebuilding the table and repeating the check on a second machine gave the same numbers to the last printed digit. This also removes that input from the (8,8) computation of \href{https://isitsolved.com/journal/62efd4034a87}{iis:2611.00174}.
\item
  \textbf{Sifting limits \(z \ge 10^7\).} For \(z \ge 10^7\) the distribution of large primes now comes from Poisson cells computed in intervals (\(\lambda\) rounded up with Dusart's bound at both ends of each cell, Poisson weights rounded down, a factor \(1 - 10^{-10}\) for the rounding of the convolutions), as in the interval (8,8) computation. The prime-power term uses \(\sum_{p \ge z} 2/(p(p-1)) \le 2/(z-1)\).
\item
  \textbf{The tail.} The tail lemma from \(10^{5000}\) had three ingredients in float64 inside margins (the Chernoff exponent for primes below \(z^{t_b}\), the Poisson cells above, and their combination). All three are now in intervals; the bound moved from \(0.0244236\) to \(0.0244241\).
\item
  \textbf{Below \(10^{16}\).} With \(a \in [16, 20]\) and \(b \in [4.75, 5.125]\) the interval computation already holds from \(10^{10.25}\); \([10^{10}, 10^{10.25}]\) fails (\(-0.0085\)), and the chain covers it.
\end{enumerate}

Predictions were written before the long runs (results/tnm/e173/cloud/prediction.json). D1a (all 414 quarter-decades of \([10^{36}, 10^{139.5}]\) pass, smallest \(W \ge 0.06\), the interval value at most \(0.03\) above the float value of E134) was right, narrowly: \(0.0606\) and \(+0.0221\). D1b (the same for the 926 rows above \(10^{139.5}\)) was not tested as stated, because that range was run on 122 wider intervals instead. D1c (the tail stays at least \(0.02\) and moves by less than \(10^{-6}\)) was right. D1d (the interval computation holds only from about \(10^{13}\)) was wrong: it holds from \(10^{10.25}\).

\hypertarget{inputs-taken-from-outside-the-computer}{%
\section{5. Inputs taken from outside the computer}\label{inputs-taken-from-outside-the-computer}}

\begin{itemize}
\tightlist
\item
  Dusart's bound \(|\vartheta(x) - x| < 0.2\,x/\ln^2 x\) for \(x \ge 3\,594\,641\) (Theorem 5.2 of arXiv:1002.0442).
\item
  The large sieve inequality with an explicit constant (Montgomery--Vaughan).
\item
  Selberg's upper-bound sieve with remainder, and Buchstab's identity.
\item
  The accuracy of the library \texttt{exp} and \texttt{log}: the interval code assumes relative error below \(10^{-12}\).
\end{itemize}

The interval computations are Python (numpy) with outward rounding. Lean checks the combinatorial steps listed in \S{}2, not the numbers; the Lean covering lemma covers \([10^{16}, 10^{36}]\) only.

\hypertarget{a-ladder-of-thresholds-and-what-this-is-not}{%
\section{6. A ladder of thresholds, and what this is not}\label{a-ladder-of-thresholds-and-what-this-is-not}}

Let \(M_r\) be the least \(M\) such that every \(W(m)\) with \(m \ge M\) contains an odd \(n\) with \(\Omega(n) + \Omega(n+2) \le r\). Theorem 1 says \(M_7 = 242\). For \(r \le 6\) we have only data. The chain of \S{}3, run so that a window with no good \(n\) is recorded (and the next \(m\) is \(m + 1\)) instead of stopping, lists every failing \(m\) below its end point:

\begin{longtable}[]{@{}
  >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.0500}}
  >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.1600}}
  >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.1300}}
  >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.1100}}
  >{\raggedright\arraybackslash}p{(\columnwidth - 8\tabcolsep) * \real{0.5500}}@{}}
\toprule\noalign{}
\begin{minipage}[b]{\linewidth}\raggedright
\(r\)
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
last \(m\) with no good \(n\) in \(W(m)\)
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
failing \(m\) (all)
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
checked to
\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright
what a proof would need
\end{minipage} \\
\midrule\noalign{}
\endhead
\bottomrule\noalign{}
\endlastfoot
7 & 241 & 40 & \(10^{12}\) & proved here \\
6 & 401 & 41 & \(10^{12}\) & level \(\approx X^{1.15}\) for these weights \\
5 & 620 & 53 & \(10^{12}\) & level \(\approx X^{1.50}\) \\
4 & 3,472 & 145 & \(10^{12}\) & level \(\approx X^{2.07}\), beyond \(X^2 \approx m/64\), the size of \(n\) itself \\
3 & 282,484 & 2,693 & \(10^{12}\) & a prime in every window: blocked by parity for sieves alone \\
2 & 136,283,522 & 728,892 & \(10^{10}\) & rule B of \href{https://isitsolved.com/journal/62efd4034a87}{iis:2611.00174} (there to \(10^{16}\)); implies the twin prime conjecture \\
\end{longtable}

Here \(X \approx \sqrt m/8\) is the number of odd \(n\) in the window, and the levels are asymptotic values from our linear-programming model of Richert's weights with the Diamond--Halberstam--Richert sieve (experiments E159, E161; a model, not a theorem). We conjecture that each \(M_r\) is the value in the table plus one. For \(r \le 3\) one of \(n, n+2\) must be prime, so no sieve argument without extra bilinear input can reach it; \(r = 6\) is out of reach of these weights because it needs a level above the length of the window.

It is an explicit statement for every window of length \(\sqrt m/4\), from a sharp threshold on. It is about almost-twins, not twins.

\hypertarget{files}{%
\section{Files}\label{files}}

Bundle \texttt{mmm-r7-window-rule.zip} (\url{https://files.isitsolved.com/files/1ceac0e98ccb79cfd98b07a3d4f9f22ee26503e6f41a25497eb0441ae0daa65f/mmm-r7-window-rule.zip}, sha256 \texttt{1ceac0e98ccb79cf\allowbreak{}d98b07a3d4f9f22e\allowbreak{}e26503e6f41a2549\allowbreak{}7eb0441ae0daa65f}): the programs (\texttt{dp\_g\_rig.py}, \texttt{r7\_low\_iv.py}, \texttt{r7\_mid\_coarse.py}, \texttt{run\_r7\_mid.py}, \texttt{r7\_big.py}, \texttt{r7\_big\_coarse.py}, \texttt{coarse\_summary.py}, \texttt{tail\_rig\_g.py}, \texttt{r7\_chain.c}, \texttt{r7\_chain\_verify.c}, \texttt{r\_chain.c}, and the interval modules they import), the checks of the corollaries (\texttt{squares\_check.py}, \texttt{p3\_check.c}), the results (\texttt{d36\_summary.json}, \texttt{r7\_low\_iv.json}, the rows and summaries of the middle and upper ranges, \texttt{tail\_r7\_5000\_rig.json}, \texttt{chain\_1e12\_summary.json}, \texttt{thresholds\_r2\_r7.json}, \texttt{squares\_check\_3000.json}, \texttt{p3\_check\_1e8.txt}), the E145 rows for \([10^{16}, 10^{36}]\), the Lean files and the predictions. Comments in the code are in Polish.

\begin{thebibliography}{9}
\bibitem{iis00174} 1kwas (posted as Imaginary1), \emph{Partial results on a window rule for twin primes: Lean
reductions, almost-twins with at most 8 prime factors each in every window \((m, m+\sqrt{m}/4]\) for \(m \ge 621\),
and parity censuses in \(\mathbb{F}_q[t]\) and \(\mathbb{Z}\)}, isitsolved.com, iis:2611.00174 (2026).
\url{https://isitsolved.com/journal/62efd4034a87}
\bibitem{bhp} R. C. Baker, G. Harman, J. Pintz, \emph{The difference between consecutive primes, II}, Proc. London
Math. Soc. (3) 83 (2001), 532--562.
\bibitem{campbell} P. J. Campbell, \emph{On the existence of integers with at most 3 prime factors between every pair
of consecutive squares}, J. Number Theory (2026), arXiv:2603.10356. \url{https://arxiv.org/abs/2603.10356}
\bibitem{dhg} H. G. Diamond, H. Halberstam, W. F. Galway, \emph{A Higher-Dimensional Sieve Method}, Cambridge Tracts
in Mathematics 177, Cambridge University Press, 2008.
\bibitem{dusart10} P. Dusart, \emph{Estimates of some functions over primes without R.H.}, arXiv:1002.0442 (2010),
Theorem 5.2. \url{https://arxiv.org/abs/1002.0442}
\bibitem{dusart18} P. Dusart, \emph{Explicit estimates of some functions over primes}, Ramanujan J. 45 (2018),
227--251. \url{https://doi.org/10.1007/s11139-016-9839-4}
\bibitem{mv} H. L. Montgomery, R. C. Vaughan, \emph{The large sieve}, Mathematika 20 (1973), 119--134.
\url{https://doi.org/10.1112/S0025579300004708}
\bibitem{oeis} OEIS Foundation, \emph{Sequence A091592: numbers \(n\) such that there are no twin primes between
\(n^2\) and \((n+1)^2\)}. \url{https://oeis.org/A091592}
\end{thebibliography}

\end{document}
