\documentclass[11pt]{amsart} \usepackage{amsmath,amssymb,amsthm,mathtools} \usepackage[margin=1.1in]{geometry} \PassOptionsToPackage{hyphens}{url} \usepackage[hidelinks]{hyperref} \hypersetup{pdftitle={Erdos problems 385 and 463 for almost all integers},pdfauthor={Meng Tong}} \DeclareTextSymbolDefault{\textsection}{OMS} \newtheorem{theorem}{Theorem}[section] \newtheorem{proposition}[theorem]{Proposition} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newtheorem*{remarks}{Remarks} \numberwithin{equation}{section} \setlength{\emergencystretch}{2em} \newcommand{\cL}{\mathcal{L}} \newcommand{\cP}{\mathcal{P}} \newcommand{\cQ}{\mathcal{Q}} \newcommand{\cA}{\mathcal{A}} \newcommand{\cE}{\mathcal{E}} \newcommand{\cU}{\mathcal{U}} \newcommand{\R}{\mathbb{R}} \newcommand{\eps}{\varepsilon} \newcommand{\dd}{\,d} \title[Erd\H{o}s problems \#385 and \#463 for almost all $n$]{Erd\H{o}s problems \#385 and \#463\\ for almost all integers} \author{Meng Tong} \date{1 December 2026} \subjclass[2020]{Primary 11N25; Secondary 11N05} \keywords{least prime factor, products of two primes, short intervals, almost all integers, Erd\H{o}s problems} \begin{document} \begin{abstract} For composite $m$ let $p(m)$ denote its least prime factor, and let $F(n)$ be the maximum of $m+p(m)$ over composite $mn$ for all large $n$, and whether $F(n)-n\to\infty$; trivially $F(n)0$, all but $O(N(\log N)^{-A})$ integers $n\le N$ satisfy $F(n)-n>(1-(\log n)^{-\kappa})\sqrt n$. Similarly, for almost all $n$ there is a composite $m$ with $n+(1-o(1))\sqrt nn}(m-p(m))=(1+o(1))\sqrt n$, the minimum being over composite $m$. The leading constant $1$ is optimal in each case. These are almost-all versions of Problems~\#385 and \#463 in Bloom's list of Erd\H{o}s problems; the versions for all large $n$ remain open. The proof bounds the variance of short-interval counts of products $pq$ with $p$ slightly below $\sqrt n$, using a pointwise bound for prime sums at scale $\sqrt n$ and the mean value theorem for Dirichlet polynomials. \end{abstract} \maketitle \section{Introduction} For an integer $m\ge2$ let $p(m)$ denote its least prime factor, so that $p(m)\le\sqrt m$ when $m$ is composite. For $n\ge5$ put \[ F(n)=\max\{m+p(m):\ mn$ for all sufficiently large $n$, and whether $F(n)-n\to\infty$, is Problem~\#385 in Bloom's list \cite{Bloom}. Trivially $F(n)n+(1-\eps)\sqrt n$ for $n>n_0(\eps)$ \cite[p.~73]{Er79}. As observed by the commenter CKS in the discussion \cite{Tao}, one has $F(n)\ge n$ for all $n\ge5$, and $F(n)=n$ forces $n-1$ to be prime, since otherwise $m=n-1$ gives $m+p(m)>n$; in particular $F(n)>n$ for almost all $n$, trivially. The largest known $n$ with $F(n)\le n$ are $267672$ and $267680$, for which $F(n)=n$ \cite{OEIS}; our computation in Section~\ref{sec:numerics} finds no larger ones below $4\cdot10^9$, and an earlier AI-assisted working report of the Erd\H{o}s Problem a Day project \cite{EPAD385} found the same $100$ exceptions in the range $5\le n\le10^9$. Tao \cite{Tao} explained why the problem seems to lie beyond current technology: he suspects that it cannot be resolved without a major breakthrough on the parity problem that would, at a bare minimum, exclude Siegel zeros. In reply to a comment, he also remarked that the methods behind Huxley's theorem on primes in almost all short intervals \cite{Huxley} should show that almost all intervals $[n-n^\theta,n]$, for $\theta$ slightly below $1/2$, contain products of two primes that are both at least $n^\theta$, and should give $F(n)=n+n^{1/2+o(1)}$ for almost all $n$. A closely related question goes back to Erd\H{o}s and Graham \cite[p.~92]{ErGr80}: given $c$, is it true that for $n>n_0(c)$ there is always a composite number $m>n+c$ for which $m-p(m)n}(m-p(m))$ and asked whether $n$ minus this quantity is asymptotic to $c\sqrt n$ for some $c>0$. Since $m-p(m)=0$ for prime $m$, we read the minimum over composite $m$ (as does the sequence A401176 in \cite{OEIS}), and put \[ F^*(n)=\min\{m-p(m):\ m>n,\ m\text{ composite}\}\qquad(n\ge1). \] Finally, in a comment on \cite{Tao} (20 August 2024), the commenter grpaseman recalled a question asked in 2016: do the open intervals $(pq-p,pq)$, with $pn$ is elementary; the content of our results is the size of $F(n)-n$ and of the analogous quantities.) \begin{theorem}\label{thm:main} Let $\kappa,A>0$ and put $\eta_n=\min\{1/2,(\log n)^{-\kappa}\}$. For all but $O_{\kappa,A}(N(\log N)^{-A})$ integers $5\le n\le N$, the following hold with $\eta=\eta_n$: \begin{enumerate} \item there are primes $p_1(1-\eta/2)\sqrt n$, $m:=p_1p_2n+(1-\eta)\sqrt n$; \item there are primes $p_1(1-\eta/2)\sqrt n$, $m:=p_1p_2>n$ and $m-p_1(1-\eta/2)\sqrt n$ and $n+(1-\eta)\sqrt nn+(1-\eps)\sqrt n$, which Erd\H{o}s suggested might hold for all large $n$, holds for all $n$ outside a set of density zero, for every fixed $\eps>0$. Since $p(p_1p_2)=p_1$ for primes $p_10$, such that every $n\ge5$ with $n\notin\cE$ satisfies \begin{align*} \Big(1-\frac1{\log n}\Big)\sqrt n&(1-1/\log n)\sqrt n$. In particular, as $n\to\infty$ outside a set of density zero, \[ F(n)=n+(1+o(1))\sqrt n\qquad\text{and}\qquad F^*(n)=n-(1+o(1))\sqrt n . \] \end{corollary} Here $\cE$ is the set of $n\ge5$ that are not $\eta_n$-good (with $\kappa=1$) in the sense of Section~\ref{sec:setup}; it does not depend on $A$. \begin{lemma}\label{lem:trivial} For every $n\ge5$ we have $F(n)n-\sqrt n$. If a composite $m$ satisfies $nn-\sqrt n$. Finally, if $nd\}$ equals $p-1$ at $n=p^2-p+1$ for every prime $p$; this explicit family, and the values of this offset for $n\le10^7$, are given in the companion working report \cite{EPAD463}. What Corollary~\ref{cor:main} adds is that $n-F^*(n)\sim\sqrt n$, and $F(n)-n\sim\sqrt n$, hold on a set of density one. \item In the same discussion \cite{Tao} grpaseman also reported that only $493$ integers up to about $10^8$ are not covered by the intervals $(pq-p,pq)$. Corollary~\ref{cor:main} shows that the uncovered integers have density zero; whether there are only finitely many is not addressed here. \item We do not claim novelty for the method. The argument is an instance of the Dirichlet polynomial method for almost all short intervals, which goes back to Huxley's work on primes \cite{Huxley}; compare also Matom\"aki and Radziwi\l\l{} \cite{MR}. Here it appears in a particularly simple configuration, as anticipated by Tao \cite{Tao}: we count products $pq$ with $p$ slightly below $\sqrt n$ in intervals of length $\asymp\eta\sqrt n$ near $n$, and the prime polynomial over $q\asymp\sqrt n$ has length comparable to these intervals, so the mean value theorem loses only a factor $1/\eta$. The only deep input is a pointwise bound for prime sums at scale $\sqrt n$ (Lemma~\ref{lem:primepoly}), which comes from the Vinogradov--Korobov zero-free region. In particular no hypothesis on Siegel zeros is needed. \item The exceptional set in Theorem~\ref{thm:main} is small only asymptotically. A Poisson heuristic (Section~\ref{sec:numerics}) suggests that the proportion of $n$ near $x$ with $F(n)-n\le(1-\eta)\sqrt n$ is about $\exp(-2\eta^2\sqrt x/(\log x)^2)$, which for $\eta=0.1$ is still about $0.1$ at $x=3\cdot10^9$; exact computations up to $4\cdot10^9$ are consistent with this. \item Problem~\#462, which appears on the same page of \cite{ErGr80}, concerns $\sum p(n)/n$ over composite $n$ in intervals of length $\asymp\sqrt x(\log x)^2$; see Zhang \cite{Zhang} and the Hexagon preprint \cite{Henriksson} for recent work. Gafni and Tao \cite{GT} proved an almost-all result for another problem from \cite{Er79}, on rough numbers between consecutive primes. None of these results implies Theorem~\ref{thm:main}, nor conversely. \end{enumerate} \end{remarks} \section{Tools}\label{sec:tools} Throughout, $p$, $q$, $p_1$, $p_2$ denote primes, $d_2$ is the divisor function and $\mathrm{Li}(y)=\int_2^y\frac{dv}{\log v}$. For $g\in L^1(\R)$ and for a finite measure $\nu$ on $\R$ we write $\hat g(t)=\int_\R g(u)e^{-itu}\dd u$ and $\hat\nu(t)=\int_\R e^{-itu}\dd\nu(u)$; then $\widehat{\nu*g}=\hat\nu\,\hat g$. \begin{lemma}[Prime number theorem]\label{lem:pnt} There is an absolute constant $c>0$ such that $\pi(y)=\mathrm{Li}(y)+O(y\exp(-c\sqrt{\log y}))$ for $y\ge2$. \end{lemma} This is the classical theorem of de la Vall\'ee Poussin; see \cite[Ch.~18]{Davenport}. \begin{lemma}[Mean value theorem]\label{lem:mvt} Let $Y\ge1$, let $(c_n)$ be complex numbers supported on $[Y/2,4Y]$, and let $T\ge2$. Then \[ \int_{-T}^T\Big|\sum_nc_nn^{-it}\Big|^2\dd t\ll(T+Y)\sum_n|c_n|^2 . \] \end{lemma} \begin{proof} By \cite[Corollary~3]{MV}, $\int_0^T|\sum_nc_nn^{-it}|^2\dd t=\sum_n(T+O(n))|c_n|^2$; see also \cite[Theorem~9.1]{IK}. The range $[-T,0]$ follows by complex conjugation. \end{proof} The only deep input is the following pointwise bound for prime sums at scale $\sqrt X$, which rests on the Vinogradov--Korobov zero-free region. \begin{lemma}\label{lem:primepoly} For every $A_3>0$ there is $B_3=B_3(A_3)\ge3$ such that the following holds for all sufficiently large $X$. Let $\cL=\log X$. For every interval $J\subset[\sqrt X/2,2\sqrt X]$ and every $t$ with $\cL^{B_3}\le|t|\le2X$, \[ \Big|\sum_{p\in J}p^{-1-it}\Big|\ll_{A_3}\cL^{-A_3}. \] \end{lemma} \begin{proof} Following \cite[\S2.4]{MRT}, we call an arithmetic function $\alpha$ \emph{$k$-divisor-bounded} if $\alpha(n)\ll_kd_2(n)^k\log^k(2+n)$; such an $\alpha$ has \emph{good cancellation} if \[ \sum_{\substack{n\le x\\ n\equiv b\ (r)}}\frac{\alpha(n)}{n^{1/2+it}}\ll_{k,A,B,B'}x^{1/2}\log^{-A}x \] for any $A,B,B'>0$, $x\ge2$, moduli $r\le\log^Bx$, residues $b\in\mathbb Z$ and $t\in\R$ with $\log^{B'}x\le|t|\le x^{B'}$, provided that $B'$ is sufficiently large depending on $A,B,k$ \cite[(29)]{MRT} (there the modulus and residue are called $q$ and $a$). By \cite[Lemma~2.7]{MRT} the M\"obius function and the function $n\mapsto\log n$ have good cancellation, and by \cite[Lemma~2.6]{MRT} so does their Dirichlet convolution $\Lambda$; this is stated in \cite{MRT} right after Lemma~2.7. We use only the modulus $r=1$. Apply the bound with $\alpha=\Lambda$, $B=1$, the exponent $A_3+1$ in place of $A$, and a fixed $B'=:B_3\ge3$ that is large enough. Let $x\in[\sqrt X/4,2\sqrt X]$ and $\cL^{B_3}\le|t|\le2X$. Then $\log^{B_3}x\le\cL^{B_3}\le|t|$ and $|t|\le2X\le x^3\le x^{B_3}$ for $X$ large, so \[ \sum_{n\le x}\Lambda(n)n^{-1/2-it}\ll X^{1/4}\cL^{-A_3-1}. \] Taking differences, the same bound holds for the sum over $n$ in any interval $J'\subset[\sqrt X/2,2\sqrt X]$. The prime powers $p^k\in J'$ with $k\ge2$ number $O(X^{1/4})$ and each contributes $\le\cL\cdot(\sqrt X/2)^{-1/2}$, so they contribute $O(\cL)$ in total. Hence $\sum_{p\in J'}(\log p)p^{-1/2-it}\ll X^{1/4}\cL^{-A_3-1}$ for every interval $J'\subset J$. Changing an endpoint of $J$ changes the sum by at most $2X^{-1/2}$, so we may assume $J=(y_1,y_2]$. Let $g(y)=y^{-1/2}/\log y$, which is positive and decreasing. By partial summation, \begin{align*} \Big|\sum_{p\in J}p^{-1-it}\Big|&=\Big|\sum_{p\in J}g(p)(\log p)p^{-1/2-it}\Big|\le g(y_1)\max_{y_1(1-\eta/2)\sqrt n$, $m:=p_1p_2n+(1-\eta)\sqrt n$. \item[(G2)] There are primes $p_1(1-\eta/2)\sqrt n$, $m:=p_1p_2>n$ and $m-p_1(1-\eta/2)\sqrt n$ and $n+(1-\eta)\sqrt nn+(1-\eta)\sqrt n$; (G2) implies $F^*(n)0$ and $A\ge1$. Let $X\ge X_0(\kappa,A)$ be sufficiently large, put $\cL=\log X$, and let $\cL^{-\kappa}\le\eta\le1/2$. Then \[ \#\{n\in(X,(1+\eta/4)X]:\ n\text{ is not }\eta\text{-good}\}\ll_{\kappa,A}\eta^{-3}X\cL^{-2A}. \] \end{proposition} \subsection{Parameters} Fix $\kappa>0$ and $A\ge1$, and let $X$ and $\eta$ be as in Proposition~\ref{prop:block}. All implied constants in Sections~\ref{sec:setup}--\ref{sec:proofprop} depend at most on $\kappa$ and $A$, and are in particular uniform in $\eta\in[\cL^{-\kappa},1/2]$; ``$X$ sufficiently large'' means $X\ge X_0(\kappa,A)$. Let \[ Q_1=\big(1-\tfrac{3\eta}{8}\big)\sqrt X,\qquad Q_2=\big(1-\tfrac{\eta}{4}\big)\sqrt X, \] \[ \cP=\{p:\ Q_10$ and $u\in\R$ define the normalized count \[ N_\eps(u)=\frac1\eps\sum_{e^u(1-\eta/2)\sqrt n$, and: \begin{enumerate} \item if $m\in W_1(n)$, then \textup{(G1)} holds with $(p_1,p_2)=(p,q)$; \item if $m\in W_2(n)$, then \textup{(G2)} holds with $(p_1,p_2)=(p,q)$; \item if $m\in W_3(n)$, then \textup{(G3)} holds with $(p_1,p_2)=(p,q)$. \end{enumerate} \end{lemma} \begin{proof} We have $\sqrt X<\sqrt n\le(1+\eta/4)^{1/2}\sqrt X\le(1+\eta/8)\sqrt X$. Since $(1-\frac\eta2)(1+\frac\eta8)=1-\frac{3\eta}8-\frac{\eta^2}{16}$, we get $p>Q_1\ge(1-\frac\eta2)\sqrt n$. Next, $m>n+\beta_j\sqrt X\ge X-\sqrt X$, so $q=m/p\ge(X-\sqrt X)/Q_2=(\sqrt X-1)/(1-\eta/4)>\sqrt X>p$, where the middle inequality is equivalent to $\eta\sqrt X>4$, which holds for $\eta\ge\cL^{-\kappa}$ once $\sqrt X>4\cL^\kappa$. \begin{enumerate} \item If $m\in W_1(n)$, then $mn-\tfrac\eta2\sqrt X+\big(1-\tfrac\eta2\big)\sqrt n\ge n+(1-\eta)\sqrt n . \] \item If $m\in W_2(n)$, then $m>n$ and $m-p\big(1-\tfrac{7\eta}8\big)\sqrt X\ge(1-\eta)\big(1+\tfrac\eta8\big)\sqrt X\ge(1-\eta)\sqrt n, \] and $m-n<(1-\frac{3\eta}4)\sqrt X(1-\frac\eta2)\sqrt n$.\qedhere \end{enumerate} \end{proof} \begin{lemma}\label{lem:logwindows} Let $X$ be sufficiently large, $n\in(X,(1+\eta/4)X]$ and $j\in\{1,2,3\}$. Put $u_n=u_n^{(j)}=\log(n+\beta_j\sqrt X)$ and $I_n=I_n^{(j)}=[u_n,u_n+\eps_j']$. Then $I_n\subset\cU$, and for every $u\in I_n$ the interval $(e^u,e^{u+\eps_j'}]$ is contained in $W_j(n)$. \end{lemma} \begin{proof} Write $\beta=\beta_j$, $\gamma=\gamma_j$ and $\eps=\eps_j=2\eps_j'$. For $u\in I_n$ we have $e^u\ge n+\beta\sqrt X$, and the interval is open on the left. On the right, $e^\eps\le1+2\eps$ since $0<\eps\le1$, and $n+\beta\sqrt X\le1.125X+\sqrt X\le1.3X$; hence \[ e^{u+\eps_j'}\le e^{u_n+\eps}\le(n+\beta\sqrt X)(1+2\eps)\le n+\beta\sqrt X+\frac{\gamma}{2\sqrt X}\cdot1.3X\sqrt X$ (as in Lemma~\ref{lem:windows}) and $y_pe^{\eps_0}\le1.2e^{\eps_0}X/Q_1\le1.21\sqrt X/(1-3/16)<1.5\sqrt X$. Hence the condition $q\in\cQ$ is automatic, and the inner sum is at least $(\pi(y_pe^{\eps_0})-\pi(y_p))/(y_pe^{\eps_0})$. By Lemma~\ref{lem:pnt}, \[ \pi(y_pe^{\eps_0})-\pi(y_p)\ge\frac{y_p(e^{\eps_0}-1)}{\log(1.5\sqrt X)}-O\big(\sqrt X\exp(-c\sqrt{\cL/2})\big)=(1-o(1))\frac{2\eps_0y_p}{\cL}, \] because the error term is smaller than the main term by a factor $\ll\cL^{1+2B_3+A}\exp(-c\sqrt{\cL/2})=o(1)$. Since $e^{-\eps_0}=1-o(1)$, the inner sum is at least $(1-o(1))2\eps_0/\cL$, and by \eqref{eq:basic} \[ N_{\eps_0}(u)\ge(1-o(1))\frac2\cL P(1)\ge(1-o(1))\frac{2\eta}{5\cL^2}\ge\frac{\eta}{4\cL^2}.\qedhere \] \end{proof} \section{The variance}\label{sec:variance} \begin{lemma}\label{lem:variance} For $X$ sufficiently large, $j\in\{1,2,3\}$ and $\eps'=\eps_j'$, \[ \int_\R|N_{\eps'}(u)-N_{\eps_0}(u)|^2\dd u\ll\eta^{-1}\cL^{-4-2A}. \] \end{lemma} \begin{proof} Let $\nu=\sum_m\frac{a(m)}m\delta_{\log m}$, a finite measure on $\R$ with $\hat\nu(t)=\sum_ma(m)m^{-1-it}=\cA(1+it)$, and let $k_\eps=\eps^{-1}1_{[-\eps,0)}$. Since $u<\log m\le u+\eps$ if and only if $-\eps\le u-\log m<0$, we have $N_\eps=\nu*k_\eps$, and \[ \hat k_\eps(t)=\frac{e^{i\eps t}-1}{i\eps t}. \] For real $\theta\neq0$ one has $|(e^{i\theta}-1)/(i\theta)|\le\min(1,2/|\theta|)$ and, since $\frac{e^{i\theta}-1}{i\theta}-1=\frac1\theta\int_0^\theta(e^{is}-1)\dd s$ and $|e^{is}-1|\le|s|$, also $|(e^{i\theta}-1)/(i\theta)-1|\le|\theta|/2$. As $\eps'<\eps_0$, it follows that for all $t$ \[ |\hat k_{\eps'}(t)-\hat k_{\eps_0}(t)|\le\min\Big(\eps_0|t|,\ 2\min\big(1,\tfrac{2}{\eps'|t|}\big)\Big). \] The functions $N_\eps$ are bounded with compact support, so by Plancherel's theorem \[ \int_\R|N_{\eps'}-N_{\eps_0}|^2\dd u=\frac1{2\pi}\int_\R|\cA(1+it)|^2|\hat k_{\eps'}(t)-\hat k_{\eps_0}(t)|^2\dd t=\frac{1}{2\pi}(V_1+V_2+V_3), \] where $V_1$, $V_2$, $V_3$ are the contributions of $|t|\le T_0$, $T_0<|t|\le X$ and $|t|>X$. \emph{Low frequencies.} Using $|\cA(1+it)|\le\cA(1)\le3\cL^{-2}$, \[ V_1\le\eps_0^2\cA(1)^2\int_{|t|\le T_0}t^2\dd t\le9\eps_0^2T_0^3\cL^{-4}=9T_0^{-1}\cL^{-4-2A}\le9\cL^{-4-2A}. \] \emph{Middle frequencies.} By Lemma~\ref{lem:primepoly} with $J=(Q_1,Q_2]\subset[\sqrt X/2,2\sqrt X]$, we have $|P(1+it)|\ll\cL^{-A-2}$ for $T_0\le|t|\le X$. Hence \begin{align*} V_2&\le4\sup_{T_0<|t|\le X}|P(1+it)|^2\int_\R\min\big(1,\tfrac{2}{\eps'|t|}\big)^2|R(1+it)|^2\dd t\\ &\ll\cL^{-2A-4}\int_\R\min\big(1,\tfrac{2}{\eps'|t|}\big)^2|R(1+it)|^2\dd t . \end{align*} Apply Lemma~\ref{lem:mvt} with $Y=\sqrt X$ and $c_q=q^{-1}1_\cQ(q)$; since $\sum_q|c_q|^2\le R(1)/\sqrt X\le3/(\sqrt X\cL)$, we get $\int_{-T}^T|R(1+it)|^2\dd t\ll(T+\sqrt X)/(\sqrt X\cL)$ for $T\ge2$. Splitting the range of $t$ into $|t|\le2/\eps'$, where the weight is at most $1$, and the ranges $2^{k+1}/\eps'<|t|\le2^{k+2}/\eps'$ ($k\ge0$), where the weight is at most $4^{-k}$, we obtain \begin{align*} \int_\R\min\big(1,\tfrac{2}{\eps'|t|}\big)^2|R(1+it)|^2\dd t&\ll\frac{2/\eps'+\sqrt X}{\sqrt X\cL}+\sum_{k\ge0}4^{-k}\frac{2^{k+2}/\eps'+\sqrt X}{\sqrt X\cL}\\ &\ll\frac{1+1/(\eps'\sqrt X)}{\cL}=\frac{1+8/\gamma_j}{\cL}\ll\frac1{\eta\cL}. \end{align*} Thus $V_2\ll\eta^{-1}\cL^{-2A-5}$. \emph{High frequencies.} Apply Lemma~\ref{lem:mvt} with $Y=X$ and $c_m=a(m)/m$, which is supported on $[X/2,4X]$; since $\sum_ma(m)^2/m^2\le(2/X)\cA(1)\le6/(X\cL^2)$, we get $\int_{-T}^T|\cA(1+it)|^2\dd t\ll(T+X)/(X\cL^2)$. On $2^kX<|t|\le2^{k+1}X$ the weight is at most $16(\eps'2^kX)^{-2}$, so \[ V_3\le16\sum_{k\ge0}(\eps'2^kX)^{-2}\int_{|t|\le2^{k+1}X}|\cA(1+it)|^2\dd t\ll\frac1{(\eps'X)^2\cL^2}=\frac{64}{\gamma_j^2X\cL^2}\ll\frac{\cL^{2\kappa}}{X}. \] Adding up, and using $\eta^{-1}\ge2$ and $\cL^{2\kappa}/X\le\cL^{-4-2A}$, gives the lemma. \end{proof} \section{Proof of Proposition~\ref{prop:block}}\label{sec:proofprop} Fix $j\in\{1,2,3\}$, let $\mathcal{B}_j$ be the set of $n\in(X,(1+\eta/4)X]$ for which (G$j$) fails, and let $Z_j=\{u\in\cU:\ N_{\eps_j'}(u)=0\}$. It suffices to show $\#\mathcal{B}_j\ll\eta^{-3}X\cL^{-2A}$. First, if $n\in \mathcal{B}_j$ then $I_n^{(j)}\subset Z_j$. Indeed $I_n^{(j)}\subset\cU$ by Lemma~\ref{lem:logwindows}. If some $u\in I_n^{(j)}$ had $N_{\eps_j'}(u)>0$, there would be an $m$ with $a(m)=1$ in $(e^u,e^{u+\eps_j'}]$, hence, by Lemma~\ref{lem:logwindows}, in $W_j(n)$; writing $m=pq$ with $p\in\cP$, $q\in\cQ$, Lemma~\ref{lem:windows} would give (G$j$), a contradiction. Second, the points $u_n=u_n^{(j)}$ are strictly increasing in $n$, with \[ u_{n+1}-u_n=\log\Big(1+\frac1{n+\beta_j\sqrt X}\Big)\ge\frac1{n+1+\beta_j\sqrt X}\ge\frac1{1.3X}, \] using $\log(1+1/y)\ge1/(y+1)$ and $n+1+\beta_j\sqrt X\le1.125X+\sqrt X+1\le1.3X$. Hence an interval of length $\eps_j'$ contains at most $1.3X\eps_j'+1\le2X\eps_j'$ of the points $u_n$; here we used $X\eps_j'=\gamma_j\sqrt X/8\ge2$. Consequently every $u$ lies in at most $2X\eps_j'$ of the intervals $I_n^{(j)}$, and \[ \eps_j'\,\#\mathcal{B}_j=\int_\R\sum_{n\in \mathcal{B}_j}1_{I_n^{(j)}}(u)\dd u\le2X\eps_j'\operatorname{meas}(Z_j), \] that is, $\#\mathcal{B}_j\le2X\operatorname{meas}(Z_j)$. Third, on $Z_j$ we have $N_{\eps_j'}=0$ while $N_{\eps_0}\ge\eta/(4\cL^2)$ by Lemma~\ref{lem:long}. By Chebyshev's inequality and Lemma~\ref{lem:variance}, \[ \operatorname{meas}(Z_j)\le\frac{16\cL^4}{\eta^2}\int_\R|N_{\eps_j'}-N_{\eps_0}|^2\dd u\ll\eta^{-3}\cL^{-2A}. \] Combining the three steps proves Proposition~\ref{prop:block}.\qed \section{Proof of Theorem~\ref{thm:main}}\label{sec:proofmain} Increasing $A$ only strengthens the theorem, so we may assume $A\ge1$; and for $N$ below any fixed bound the statement is trivial after adjusting the implied constant. Put $A_1=A+2\kappa\ge1$, let $N$ be large, and set $\eta_*=(\log2N)^{-\kappa}$. Integers $n\le N(\log N)^{-A}$ contribute at most $N(\log N)^{-A}$. For the rest, let $X_i=N(1+\eta_*/4)^{-i}$ for $i=1,\dots,K$, where $K$ is the least integer with $X_K\le N(\log N)^{-A}$. The intervals $(X_i,X_{i-1}]=(X_i,(1+\eta_*/4)X_i]$ cover $(N(\log N)^{-A},N]$, and $X_i\ge X_{K-1}/2>N(\log N)^{-A}/2$ for every $i\le K$. Hence $\log X_i\ge\frac12\log2N$, so that \[ \eta_*\ge2^{-\kappa}(\log X_i)^{-\kappa}\ge(\log X_i)^{-2\kappa}\qquad\text{and}\qquad\eta_*\le1/2 \] for $N$ large, and $X_i\ge X_0(2\kappa,A_1)$. Proposition~\ref{prop:block}, applied with $2\kappa$ in place of $\kappa$, $A_1$ in place of $A$, $X=X_i$ and $\eta=\eta_*$, shows that the number of $n\in(X_i,X_{i-1}]$ that are not $\eta_*$-good is \[ \ll\eta_*^{-3}X_i(\log X_i)^{-2A_1}\ll\eta_*^{-3}X_i(\log N)^{-2A_1}. \] Since $\sum_{i\ge1}X_i\le4N/\eta_*$, the total is $\ll\eta_*^{-4}N(\log N)^{-2A_1}\ll N(\log N)^{-2A}\le N(\log N)^{-A}$. Finally, for $5\le n\le N$ and $N$ large we have $\eta_n=\min\{1/2,(\log n)^{-\kappa}\}\ge\eta_*$, so by monotonicity every $\eta_*$-good $n$ is $\eta_n$-good. This proves Theorem~\ref{thm:main}.\qed \section{Numerical illustration}\label{sec:numerics} We computed $F(n)$, $F^*(n)$ and \[ M(n)=\max\{m\text{ composite}:\ m-p(m)n+f$. Put \[ r_1=\frac{F(n)-n}{\sqrt n},\qquad r_2=\frac{n-F^*(n)}{\sqrt n},\qquad r_3=\frac{M(n)-n}{\sqrt n}; \] note that $M(n)\ge n$ always (take $m=n+1$ or $m=n$, whichever is even). Table~\ref{tab:num} shows, for $r_1$, the minimum over each range and the proportion of $n$ in the range with $r_1\le1-\eta$, i.e.\ with $F(n)\le n+(1-\eta)\sqrt n$; the proportions were decided exactly in integer arithmetic. The proportions for $r_2$ and $r_3$ differ from those for $r_1$ by at most $0.004$ in the ranges shown, and for $n>10^6$ their minima are slightly smaller ($0.705$ for both in the last range). Among the integers $5\le n\le4\cdot10^9$, exactly $100$ satisfy $F(n)\le n$, and all of them satisfy $F(n)=n$, as they must by the observation in Section~1. The list agrees with A322293 in \cite{OEIS}, which is complete up to $10^8$, and with the list up to $10^9$ in \cite{EPAD385}. The two largest in the computed range are $267672$ and $267680$. \begin{table}[ht] \centering \small \begin{tabular}{lccccc} & & \multicolumn{3}{c}{proportion with $r_1\le1-\eta$} & heuristic\\ range of $n$ & $\min r_1$ & $\eta=0.3$ & $\eta=0.2$ & $\eta=0.1$ & $\eta=0.1$\\ \hline $(10^{5},10^{6}]$ & 0.000 & 0.4402 & 0.7037 & 0.9189 & 0.9210 \\ $(10^{6},10^{7}]$ & 0.247 & 0.1568 & 0.4494 & 0.8254 & 0.8285 \\ $(10^{7},10^{8}]$ & 0.433 & 0.0153 & 0.1520 & 0.6245 & 0.6389 \\ $(10^{8},10^{9}]$ & 0.577 & 0.0001 & 0.0136 & 0.3232 & 0.3356 \\ $(10^{9},4\cdot10^{9}]$ & 0.715 & 0.0000 & 0.0003 & 0.1171 & 0.1285 \\ \end{tabular} \medskip \caption{Statistics of $r_1=(F(n)-n)/\sqrt n$, computed exactly for every $n$ in each range; proportions are rounded to four decimals (the entry $0.0000$ in the last row is exactly $0$). The last column is the average over the range of the heuristic prediction $\exp(-2\eta^2\sqrt n/(\log n)^2)$ for the proportion with $r_1\le1-\eta$, at $\eta=0.1$.}\label{tab:num} \end{table} The slow convergence is explained by a simple Poisson model. The integers $m=p_1p_2$ with $p_1\in[y\sqrt n,(y+dy)\sqrt n]$ and $m\in[n-(x+dx)\sqrt n,n-x\sqrt n]$ number about $4\sqrt n\,dx\,dy/(y(\log n)^2)$. The inequality $F(n)\le n+(1-\eta)\sqrt n$ means that there is no such $m$ with $0(1-\eta)\sqrt n$ is of this form. This triangle has weighted area $\int_0^\eta\int_{1-\eta+x}^1\frac{dy}{y}\,dx=\eta+(1-\eta)\log(1-\eta)=\frac{\eta^2}2+O(\eta^3)$; keeping only the leading term $\eta^2/2$ gives the prediction in Table~\ref{tab:num}. The conditions on $F^*(n)$ and $M(n)$ correspond to triangles of the same weighted area, consistent with the near-identical statistics. The model treats different $n$ as independent only through the expected proportion; failures in fact occur in runs of consecutive $n$. For $\eta=0.1$ the predicted proportion drops to about $10^{-2}$ near $n=1.6\cdot10^{10}$ and to about $5\cdot10^{-5}$ at $n=10^{11}$. \section*{Statement on the use of AI} This paper was prepared with substantial assistance from an AI system, Anthropic's Claude, used through Claude Code under the direction of the author. The statements and proofs, the computer programs behind Section~\ref{sec:numerics}, the literature search and the text were generated by the AI system. The proof and the numerical results were checked by AI models, including fresh instances of the model that wrote the paper. At the time of writing, no human referee has checked the proof. AI systems are not listed as authors; the author is responsible for the content. \begin{thebibliography}{99} \sloppy \bibitem{Bloom} T. F. Bloom, \emph{Erd\H{o}s problems}, \url{https://www.erdosproblems.com}, Problems \#385 and \#463 (accessed 1 December 2026). \bibitem{Davenport} H. Davenport, \emph{Multiplicative Number Theory}, 3rd ed., revised and with a preface by H. L. Montgomery, Grad. Texts in Math. 74, Springer-Verlag, New York, 2000. \bibitem{EPAD385} Erd\H{o}s Problem a Day (P. White, with Claude), \emph{Erd\H{o}s Problem \#385: Composite $m$ plus least prime factor --- working report}, \url{https://www.erdosproblemaday.com/report/385} (accessed 1 December 2026). \bibitem{EPAD463} Erd\H{o}s Problem a Day (P. White, with Claude), \emph{Erd\H{o}s Problem \#463: Composite $m$ with $n+f(n)