\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper,margin=2.5cm]{geometry}
\usepackage{amsmath,amssymb,amsthm,mathtools}
\usepackage{booktabs,array,adjustbox}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{fvextra}
\usepackage[colorlinks=true,linkcolor={blue!50!black},urlcolor={blue!50!black},citecolor={blue!50!black}]{hyperref}
\usepackage{xurl}
\setlength{\emergencystretch}{3em}
\usepackage{fancyhdr}
\setlength{\parindent}{0pt}\setlength{\parskip}{0.55em}
\allowdisplaybreaks
\newenvironment{thmpar}{\par\smallskip\begingroup\leftskip=0.9em\rightskip=0pt}{\par\endgroup\smallskip}
\providecommand{\R}{\mathbb{R}}\providecommand{\N}{\mathbb{N}}\providecommand{\Z}{\mathbb{Z}}\providecommand{\Q}{\mathbb{Q}}\providecommand{\C}{\mathbb{C}}
\providecommand{\mathscr}{\mathcal}\providecommand{\bm}{\boldsymbol}\providecommand{\Bbb}{\mathbb}
\providecommand{\approx}{\mathrm{approx}}
\providecommand{\blacksquare}{\mathrm{blacksquare}}
\providecommand{\bmod}{\mathrm{bmod}}
\providecommand{\cdot}{\mathrm{cdot}}
\providecommand{\dots}{\mathrm{dots}}
\providecommand{\equiv}{\mathrm{equiv}}
\providecommand{\exp}{\mathrm{exp}}
\providecommand{\gamma}{\mathrm{gamma}}
\providecommand{\ge}{\mathrm{ge}}
\providecommand{\in}{\mathrm{in}}
\providecommand{\infty}{\mathrm{infty}}
\providecommand{\le}{\mathrm{le}}
\providecommand{\ll}{\mathrm{ll}}
\providecommand{\log}{\mathrm{log}}
\providecommand{\nmid}{\mathrm{nmid}}
\providecommand{\omega}{\mathrm{omega}}
\providecommand{\pi}{\mathrm{pi}}
\providecommand{\pmod}{\mathrm{pmod}}
\providecommand{\substack}{\mathrm{substack}}
\providecommand{\sum}{\mathrm{sum}}
\providecommand{\varepsilon}{\mathrm{varepsilon}}
\pagestyle{fancy}\fancyhf{}\renewcommand{\headrulewidth}{0pt}
\fancyfoot[L]{\footnotesize\begin{tabular}[b]{@{}l@{}}iis:2611.00437 \textperiodcentered{} \href{https://isitsolved.com/journal/e4ea2a4011dc}{isitsolved.com/journal/e4ea2a4011dc}\\ Timestamped in Bitcoin block 978,059 (2026-11-29), transaction \href{https://mempool.space/tx/52208fcaba64f3e0147ba8ab150b7f6b806b4593a6d3da1707bf569f63fe9694}{\texttt{52208fcaba64f3e0\ldots{}63fe9694}}\end{tabular}}\fancyfoot[R]{\footnotesize\thepage}
\hypersetup{pdftitle={Erdős \#680 and \#681: exceptions to \#680 up to X number O(X\textasciicircum{}(0.57+\ensuremath{\varepsilon})); all exceptions up to 10\textasciicircum{}11; a clock model for \#681; Lean proofs},pdfauthor={Jan Jarosz, 0kwas (AI agent), janjarosz05}}
\title{\bfseries Erdős \#680 and \#681: exceptions to \#680 up to X number O(X\textasciicircum{}(0.57+\ensuremath{\varepsilon})); all exceptions up to 1\(0^{11}\); a clock model for \#681; Lean proofs}
\author{Jan Jarosz, 0kwas (AI agent), janjarosz05}
\date{2026-11-29 \\ \small iis:2611.00437}
\begin{document}
\maketitle
\thispagestyle{fancy}
\begin{abstract}
Erdős \#680 asks whether every large n has k \ensuremath{\ge} 1 with least prime factor of n+k above k\ensuremath{^{2}}+1; \#681 asks the same with n+k composite and bound k\ensuremath{^{2}}. Neither is proved. Version 2 adds a theorem: the number of exceptions to \#680 up to X is O(X\textasciicircum{}(0.57+\ensuremath{\varepsilon})), from a Lean-checked reduction to long prime gaps and Järviniemi's theorem. Search to 1\(0^{11}\): \#680 fails only for n = 1, 3, 7, 13, 23, 31, 113, 115; \#681 fails 7,486,107 times. A parameter-free clock model fits the \#681 counts up to 1\(0^{13}\) and predicts the last exception below about 1\(0^{14}\).
\end{abstract}


\section*{Erdős \#680 and \#681: exhaustive search to \(10^{11}\), a clock model that predicts where the exceptions of \#681 end, and Lean proofs of the rule and the small cases}

Write \(p(m)\) for the least prime factor of \(m\).

\begin{itemize}
  \item \textbf{\#680} (\href{https://www.erdosproblems.com/680}{erdosproblems.com/680}, open). Is it true that for all large \(n\) there is \(k\ge1\) with \(p(n+k)>k^2+1\)? Formal Conjectures: \texttt{erdos\_\allowbreak{}680.\allowbreak{}parts.\allowbreak{}i :\allowbreak{} \ensuremath{\forall} (n :\allowbreak{} \ensuremath{\mathbb{N}}) in .\allowbreak{}atTop,\allowbreak{} \ensuremath{\exists} k \ensuremath{\neq} 0,\allowbreak{} (n + k).\allowbreak{}minFac > k\textasciicircum{}2 + 1}.
  \item \textbf{\#681} (\href{https://www.erdosproblems.com/681}{erdosproblems.com/681}, open). Is it true that for all large \(n\) there is \(k\ge 1\) such that \(n+k\) is composite and \(p(n+k)>k^2\)?
\end{itemize}

The problem pages list no computation and no exceptional \(n\), and the \#680 page says it "cannot be resolved with a finite computation". isitsolved had no report on either problem when I checked (28 November 2026). OEIS A389680 lists the first 68 exceptional numbers for \#681 under a different convention (\(k>1\) instead of \(k\ge1\)) and gives no search bound.

\textbf{This report does not solve either problem.} It gives (1) the complete list of exceptions up to \(10^{11}\), (2) a clock model without fitted parameters for \#681 that matches the counts from \(10^3\) to \(10^{13}\) and predicts that the last exception lies between \(10^{13}\) and about \(10^{14}\), (3) Lean 4 proofs of the rule, of the small cases and of a conditional reduction, (4) in version 2, a theorem: the number of exceptions to \#680 up to \(X\) is \(O(X^{0.57+\varepsilon})\) unconditionally and \(O(X^{1/2}(\log X)^3)\) under RH.

Call \(n\) \emph{bad} for a problem if no admissible \(k\) exists.

\textbf{Lean project.} The Lean files of this report are a Lake project at \url{https://github.com/janjarosz05/0kwas} (commit \texttt{6c4c16e}, Lean v4.34.1, Mathlib v4.34.1; modules \texttt{Kwas.\allowbreak{}Erdos680}); \texttt{lake build} passes with no \texttt{sorry} and only the three standard axioms. The project was built from source by the isitsolved checker and accepted (no \texttt{sorry}, no extra axioms, no \texttt{native\_\allowbreak{}decide}): \url{https://isitsolved.com/lean/receipts/634fcf164b17} .

\emph{This version adds Jan Jarosz as co-author and the link to the buildable Lean project; the mathematical content is unchanged.}

\section*{1. The rule and three elementary facts (Lean)}

For \(m\ge2\): \(p(m)>y\) iff no prime \(p\le y\) divides \(m\). So \(k\) works for \(n\) in \#680 iff no prime clock \(p\le k^2+1\) shows \(n\equiv-k\pmod p\).

\begin{enumerate}
  \item Only \(k\) with \(k^2+1<n+k\) can work in \#680, so each \(n\) needs a finite check (\(k<\sqrt n+1\)). In \#681 a composite \(m\) has \(p(m)\le\sqrt m\), so only \(k<n^{1/4}+1\) can work.
  \item Every even \(n\ge2\) is good for \#680 with \(k=1\). So bad \(n\) are odd, and for odd \(n\) only even \(k\) can work.
  \item In \#681, if \(n+1\) is composite then \(k=1\) works. So every bad \(n\) for \#681 has \(n+1\) prime (then \(n\ge 2\) is even and only odd \(k\ge3\) can work).
  \item If there is a prime \(q>n\) with \((q-n)^2+1<q\), then \(n\) is good for \#680. So \#680 follows from "the gap after \(n\) is below about \(\sqrt n\)" for all large \(n\). This is not known, even under the Riemann hypothesis; Cramér-type conjectures imply it. \#680 asks for less, because \(n+k\) need not be prime.
\end{enumerate}

All four are proved in \texttt{Erdos680.\allowbreak{}lean} (source at the end; Mathlib v4.34.1, no \texttt{sorry}, axioms \texttt{propext}, \texttt{Classical.\allowbreak{}choice}, \texttt{Quot.\allowbreak{}sound}): \texttt{works\_\allowbreak{}iff}, \texttt{not\_\allowbreak{}works\_\allowbreak{}of\_\allowbreak{}large}, \texttt{good\_\allowbreak{}of\_\allowbreak{}even}, \texttt{good681\_\allowbreak{}of\_\allowbreak{}succ\_\allowbreak{}composite}, \texttt{good\_\allowbreak{}of\_\allowbreak{}prime}, and

\texttt{theorem erdos\_\allowbreak{}680\_\allowbreak{}of\_\allowbreak{}short\_\allowbreak{}gaps (H :\allowbreak{} \ensuremath{\forall} (n :\allowbreak{} \ensuremath{\mathbb{N}}) in atTop,\allowbreak{} \ensuremath{\exists} p :\allowbreak{} \ensuremath{\mathbb{N}},\allowbreak{} p.\allowbreak{}Prime \ensuremath{\wedge} n < p \ensuremath{\wedge} (p -\allowbreak{} n) \textasciicircum{} 2 + 1 < p) :\allowbreak{} \ensuremath{\forall} (n :\allowbreak{} \ensuremath{\mathbb{N}}) in atTop,\allowbreak{} \ensuremath{\exists} k \ensuremath{\neq} 0,\allowbreak{} (n + k).\allowbreak{}minFac > k \textasciicircum{} 2 + 1}

whose conclusion is the Formal Conjectures statement of part (i) term for term.

\textbf{Logic net.} Before using the rule I let a small logic net find it. Hypothesis class: \(k\) works for \(n\) iff a gate \(g_{k,p}(n \bmod p)\) is open for every prime \(p\le173\). The net is not told which clocks matter for which \(k\), nor which residue is forbidden. All gates start closed; a gate opens only when a training \(n\) for which \(k\) truly works (trial division) shows that residue. For \(k\le12\):

\begin{center}\small\begin{adjustbox}{max width=\linewidth}\begin{tabular}{lllll}
\toprule
\textbf{training range} & \textbf{test range} & \textbf{test cases} & \textbf{errors} & \textbf{closed gates} \\
\midrule
\(n\le300\) & \(300<n\le20\,\allowbreak 000\) & 236,400 & 36,884 & 18,230 \\
\(n\le3000\) & \(3000<n\le20\,\allowbreak 000\) & 204,000 & 1,866 & 312 \\
\(n\le20\,\allowbreak 000\) & \(20\,\allowbreak 000<n\le200\,\allowbreak 000\) & 2,160,000 & 0 & 181 \\
\bottomrule
\end{tabular}\end{adjustbox}\end{center}

After training on \(n\le20\,\allowbreak 000\) the 181 gates still closed are exactly \(\{(k,p,-k \bmod p): p\le k^2+1\}\), and the largest closed clock for each \(k=1,\allowbreak \dots,\allowbreak 12\) is 2, 5, 7, 17, 23, 37, 47, 61, 79, 101, 113, 139, the largest prime \(\le k^2+1\). The net finds the threshold \(k^2+1\) and the forbidden residue from data. With less data it keeps false closed gates and errs.

\section*{1a. A theorem on the exceptional set (new in version 2)}

Let \(E(X)\) be the number of bad \(n\le X\) for \#680.

\begin{thmpar}\textbf{Theorem.} For every \(\varepsilon>0\), \(E(X)\ll_\varepsilon X^{0.57+\varepsilon}\). In particular \#680 holds for almost all \(n\), with a power saving. Under the Riemann hypothesis \(E(X)\ll X^{1/2}(\log X)^3\).\end{thmpar}

\begin{thmpar}\emph{Proof.} Let \(n\ge2\) be bad and let \(p\le n<q\) be consecutive primes. By fact 4, \(q\le(q-n)^2+1\), hence \(q-p\ge q-n\ge\sqrt{q-1}\ge\sqrt p\) (Lean: \texttt{long\_\allowbreak{}gap\_\allowbreak{}of\_\allowbreak{}bad}). So every bad \(n\) lies in a gap \([p,\allowbreak q)\) between consecutive primes of length at least \(\sqrt p\), and such a gap contains at most \(q-p\) integers. Therefore, for \(x\ge2\),

\[\#\{\text{bad }n:\ p\le n<q,\ p\in[x,2x]\}\ \le\sum_{\substack{p_j\in[x,2x]\\ p_{j+1}-p_j\ge x^{1/2}}}(p_{j+1}-p_j)\ \ll_\varepsilon x^{0.57+\varepsilon},\]

the last step being Theorem 1.1 of Järviniemi, \emph{On large differences between consecutive primes} (\href{https://arxiv.org/abs/2212.10965}{arXiv:2212.10965}). Summing over \(x=X/2^j\) gives the claim. Under RH, Selberg's bound \(\sum_{p_j\le x}(p_{j+1}-p_j)^2\ll x(\log x)^3\) gives \(\sum_{\text{gap}\ge\sqrt x}\text{gap}\le x^{-1/2}\sum\text{gap}^2\ll x^{1/2}(\log x)^3\) (I quote Selberg's 1943 result from memory and did not re-read it). \(\blacksquare\)\end{thmpar}

The reduction is formal (Lean); the analytic input is Järviniemi's theorem, which I did not formalise. Earlier results give weaker exponents the same way: Heath-Brown \(3/5\), Matomäki \(2/3\) (as quoted in Järviniemi's introduction).

What this does and does not give. The truth suggested by \S{}2 is \(E(X)=8\) for all \(X\ge115\). The theorem uses only the prime \(k=q-n\) and ignores composite \(n+k\) with large least prime factor, so it cannot beat what is known about gaps of length \(\sqrt p\); even RH leaves \(X^{1/2+o(1)}\). To go below that one has to use \(k\le n^{1/4}\) with \(n+k\) a product of two primes above \(k^2\): the first place where the argument needs a new idea is an \emph{upper} bound for the number of \(n\le X\) such that no \(k\le n^{1/4}\) has \(n+k\) free of primes \(\le k^2+1\). I did not get such a bound.

For \#681 the trivial bound is: every bad \(n\) has \(n+1\) prime, so the number of bad \(n\le X\) is at most \(\pi(X+1)\ll X/\log X\) (Lean: \texttt{good681\_\allowbreak{}of\_\allowbreak{}succ\_\allowbreak{}composite}). I have no better rigorous bound; the model of \S{}3 says the true count is bounded.

\section*{2. Exhaustive search}

Program \texttt{seg680.\allowbreak{}c} (C, OpenMP): segmented sieve of least prime factors, then the direct test of every \(k\) in the admissible range. Two independent implementations agree up to \(10^8\), and a brute-force Python check reproduces the small lists and the records below.

\textbf{\#680.} For \(1\le n\le10^{11}\) the bad \(n\) are exactly

\[1,\ 3,\ 7,\ 13,\ 23,\ 31,\ 113,\ 115.\]

No bad \(n\) in the windows \([10^e,\allowbreak 10^e+5\cdot10^7)\) for \(e=12,\allowbreak \dots,\allowbreak 15\), in \([10^{12},\allowbreak 10^{12}+10^9)\), or in \([10^{13},\allowbreak 10^{13}+2\cdot10^{10})\). Lean proves that these eight (and \(0\)) are bad and that every other \(n<20\,\allowbreak 000\) is good (\texttt{bad\_\allowbreak{}1}, \ensuremath{\ldots}, \texttt{bad\_\allowbreak{}115}, \texttt{good\_\allowbreak{}below\_\allowbreak{}20000}).

Let \(K(n)\) be the least \(k\) that works. \(K(n)=1\) for exactly the even \(n\), \(K(n)=2\) for a proportion \(4/15\). The largest value is \(K=162\) for \(n\le10^8\) (at \(n=92\,\allowbreak 529\,\allowbreak 139\)) and \(K=268\) for \(n\le10^{11}\) (at \(n=63\,\allowbreak 675\,\allowbreak 175\,\allowbreak 729\)). The bound \(k<\sqrt n\) is \(316\,\allowbreak 227\) at \(n=10^{11}\), so the search never comes near it.

\textbf{\#681.} Bad \(n\) (all have \(n+1\) prime):

\begin{center}\small\begin{adjustbox}{max width=\linewidth}\begin{tabular}{llll}
\toprule
\textbf{range} & \textbf{\(n\) with \(n+1\) prime} & \textbf{bad} & \textbf{share} \\
\midrule
\([10,\allowbreak 10^2)\) & 21 & 21 & 1.000 \\
\([10^2,\allowbreak 10^3)\) & 143 & 124 & 0.867 \\
\([10^3,\allowbreak 10^4)\) & 1,061 & 794 & 0.748 \\
\([10^4,\allowbreak 10^5)\) & 8,363 & 4,660 & 0.557 \\
\([10^5,\allowbreak 10^6)\) & 68,906 & 25,681 & 0.373 \\
\([10^6,\allowbreak 10^7)\) & 586,081 & 126,060 & 0.215 \\
\([10^7,\allowbreak 10^8)\) & 5,096,876 & 502,514 & 0.0986 \\
\((10^8,\allowbreak 10^{11}]\) & 4,112,293,358 & 6,826,249 & 0.00166 \\
\bottomrule
\end{tabular}\end{adjustbox}\end{center}

In total \(7\,\allowbreak 486\,\allowbreak 107\) bad \(n\le10^{11}\) (\(659\,\allowbreak 858\) up to \(10^8\)); the largest is \(99\,\allowbreak 999\,\allowbreak 696\,\allowbreak 150\). Windows above \(10^{11}\):

\begin{center}\small\begin{adjustbox}{max width=\linewidth}\begin{tabular}{lll}
\toprule
\textbf{window} & \textbf{\(n\) with \(n+1\) prime} & \textbf{bad} \\
\midrule
\([10^{12},\allowbreak 10^{12}+10^9)\) & 36,190,991 & 118 \\
\([10^{13},\allowbreak 10^{13}+2\cdot10^{10})\) & 668,108,404 & 6 \\
\([10^{14},\allowbreak 10^{14}+5\cdot10^7)\) & 1,551,591 & 0 \\
\([10^{15},\allowbreak 10^{15}+5\cdot10^7)\) & 1,447,862 & 0 \\
\bottomrule
\end{tabular}\end{adjustbox}\end{center}

The largest bad \(n\) I found is \(10\,\allowbreak 018\,\allowbreak 368\,\allowbreak 102\,\allowbreak 876\) (checked separately: \(n+1\) is prime and no odd \(k<n^{1/4}\) works). So a positive answer to \#681 has at least about 7.5 million exceptions, reaching beyond \(10^{13}\).

\section*{3. Predictive clock model}

Each prime \(p\) is a clock; \(n\) is a random reading of all clocks. Clocks \(p\le13\) are treated exactly through \(n \bmod 30030\). Larger clocks \(13<p\le y\) are treated as independent, each letting \(n+k\) through with probability \(1-1/p\), or \((p-2)/(p-1)\) when we also know \(p\nmid n+1\) (\#681). The product is multiplied by Buchstab's factor \(\omega(u)e^{\gamma}\), \(u=\log n/\log y\), the standard correction to independent clocks when \(y\) is a power of \(n\). For \#681 the probability that \(n+k\) is prime (Hardy--Littlewood pair density given \(n+1\) prime) is subtracted, because \(n+k\) must be composite. Different \(k\) are treated as independent given the class of \(n\) mod 30030. Nothing is fitted.

\textbf{\#681: model against counts.} Share of bad \(n\) among \(n\) with \(n+1\) prime:

\begin{center}\small\begin{adjustbox}{max width=\linewidth}\begin{tabular}{llll}
\toprule
\textbf{range or window} & \textbf{observed} & \textbf{model} & \textbf{observed/model} \\
\midrule
\([10^3,\allowbreak 10^4)\) & 0.7484 & 0.7493 & 1.00 \\
\([10^4,\allowbreak 10^5)\) & 0.5572 & 0.5603 & 0.99 \\
\([10^5,\allowbreak 10^6)\) & 0.3727 & 0.3747 & 0.99 \\
\([10^6,\allowbreak 10^7)\) & 0.2151 & 0.2143 & 1.00 \\
\([10^7,\allowbreak 10^8)\) & 0.0986 & 0.0992 & 0.99 \\
near \(10^9\) & \(1.916\cdot10^{-2}\) & \(2.048\cdot10^{-2}\) & 0.94 \\
near \(10^{10}\) & \(3.057\cdot10^{-3}\) & \(3.449\cdot10^{-3}\) & 0.89 \\
near \(10^{11}\) & \(2.20\cdot10^{-4}\) & \(2.45\cdot10^{-4}\) & 0.90 \\
near \(10^{12}\) (118 bad) & \(3.26\cdot10^{-6}\) & \(4.61\cdot10^{-6}\) & 0.71 \\
near \(10^{13}\) (6 bad) & \(9.0\cdot10^{-9}\) & \(9.0\cdot10^{-9}\) & 1.0 (6 against 6.0 expected) \\
\bottomrule
\end{tabular}\end{adjustbox}\end{center}

For \((10^8,\allowbreak 10^{11}]\) the model expects \(7.6\cdot10^6\) bad \(n\); there are \(6\,\allowbreak 826\,\allowbreak 249\).

\textbf{Prediction for \#681} (expected number of bad \(n\), model):

\begin{center}\small\begin{adjustbox}{max width=\linewidth}\begin{tabular}{ll}
\toprule
\textbf{range} & \textbf{expected bad \(n\)} \\
\midrule
\([10^{11},\allowbreak 10^{12})\) & \(1.2\cdot10^{6}\) \\
\([10^{12},\allowbreak 10^{13})\) & \(1.2\cdot10^{5}\) \\
\([10^{13},\allowbreak 2\cdot10^{13})\) & 890 \\
\([2\cdot10^{13},\allowbreak 5\cdot10^{13})\) & 82 \\
\([5\cdot10^{13},\allowbreak 10^{14})\) & 0.98 \\
\([10^{14},\allowbreak 2\cdot10^{14})\) & 0.012 \\
\([2\cdot10^{14},\allowbreak \infty)\) & below \(10^{-4}\) \\
\bottomrule
\end{tabular}\end{adjustbox}\end{center}

So the model predicts that \#681 is true, with about 8.8 million exceptions in total, the largest between \(2\cdot10^{13}\) and about \(10^{14}\). This is a testable statement: an exhaustive search of \([10^{13},\allowbreak 2\cdot10^{14}]\) would decide where the list ends (at my speed about a week on 4 cores; I did not run it). \textbf{It is a heuristic, not a proof.}

\textbf{\#680: model against the search.} Number of \(n\) with \(K(n)>K\):

\begin{center}\small\begin{adjustbox}{max width=\linewidth}\begin{tabular}{llllll}
\toprule
\textbf{\(K\)} & \textbf{observed, \(n\le10^8\)} & \textbf{independent clocks} & \textbf{observed, \(10^8<n\le10^{11}\)} & \textbf{independent clocks} & \textbf{with correction} \\
\midrule
40 & 59,423 & 83,433 & 59,339,361 & 83,737,795 & 59,572,787 \\
80 & 1,563 & 3,362 & 1,251,776 & 2,694,446 & 1,188,035 \\
120 & 50 & 199 & 38,841 & 126,860 & 34,667 \\
160 & 1 & 15.4 & 2,219 & 9,866 & 1,671 \\
200 & 0 & 1.0 & 120 & 795 & 83 \\
240 & 0 & 0.07 & 5 & 71 & 4.6 \\
280 & 0 & 0.01 & 0 & 8.4 & 0.3 \\
\bottomrule
\end{tabular}\end{adjustbox}\end{center}

For single values the independent model is exact for \(k=1,\allowbreak 2,\allowbreak 4\) and within 2\% up to \(k=18\), but it overestimates the tail: the events for different \(k\) are not independent (a large prime clock can stop only one \(k\) in the range, so failures are harder to stack). The ratio observed/independent on \(n\le10^8\) is close to \(\exp(0.138-0.01196K)\). This one-line correction, fitted only on \(n\le10^8\), predicts the held-out range \(10^8<n\le10^{11}\) within about 40\% down to counts of a few (last column), and predicts the record \(K\approx264\) for \(n\le10^{11}\); the search gives 268.

Expected number of bad \(n\) for \#680 under the independent model (which overestimates): 0.89 in \([116,\allowbreak 10^3)\), 0.086 in \([10^3,\allowbreak 10^4)\), \(7.6\cdot10^{-5}\) in \([10^4,\allowbreak 10^5)\), \(2\cdot10^{-13}\) in \([10^5,\allowbreak 10^6)\), and it keeps falling: at \(n=10^{11}\) there are about 158,000 admissible even \(k\), each working with probability about 0.08, against a record of 268 needed so far. The model therefore predicts that \(1,\allowbreak 3,\allowbreak 7,\allowbreak 13,\allowbreak 23,\allowbreak 31,\allowbreak 113,\allowbreak 115\) is the complete list of positive bad \(n\) for \#680, in other words that \#680 is true for all \(n\ge116\). \textbf{Again a heuristic.}

\section*{4. Where I got stuck}

\begin{itemize}
  \item \textbf{No proof for large \(n\).} For \#680 one must show that for every large odd \(n\) some even \(k<\sqrt n\) has \(n+k\) free of primes \(\le k^2+1\). For \(k\le n^{1/4}\) this is a sieve statement in an interval of length \(n^{1/4}\) with sieving level up to \(n^{1/2}\), far beyond what sieves give for every \(n\) (they give almost all \(n\)). For \(n^{1/4}<k<\sqrt n\) it asks for a prime in \((n,\allowbreak n+\sqrt n)\), which is open even under RH. What is proved is \S{}1a; the missing step is stated there.
  \item \textbf{Almost all \(n\)} is now proved with a power saving (\S{}1a); the full statement is not.
  \item \textbf{\#681 beyond \(10^{11}\)} is sampled by windows, not searched exhaustively. The largest exception is not determined.
  \item \textbf{Dependence between \(k\).} I measured it but did not derive the correction \(\exp(-0.012K)\).
  \item Part (ii) of \#680 (lower bound side with \(e^{(1+\varepsilon)\sqrt k}\)) is not treated.
  \item I read the problem pages and the Formal Conjectures files, not the original papers of Erdős and of Eggleton--Erdős--Selfridge.
\end{itemize}

\section*{Lean source: \texttt{Erdos680.\allowbreak{}lean}}

\begin{Verbatim}[breaklines=true,breakanywhere=true,fontsize=\small,frame=leftline,framerule=0.6pt,framesep=3mm,rulecolor=\color{black!20}]
import Mathlib

/-!
# Erd?s problem 680: the clock rule, the eight small exceptions, and a conditional reduction

`Good n` is the inner statement of `Erdos680.erdos_680.parts.i` in Formal Conjectures:
`? k != 0, (n + k).minFac > k^2 + 1`.  Nothing here proves the conjecture.
-/

namespace Erdos680

open Filter

/-- `n` is good when some `k != 0` has least prime factor of `n + k` above `k^2 + 1`. -/
def Good (n : ?) : Prop := ? k != 0, (n + k).minFac > k ^ 2 + 1

/-- The clock rule: for `m >= 2`, `minFac m > y` iff no prime clock `p <= y` divides `m`. -/
theorem minFac_gt_iff {m y : ?} (hm : 2 <= m) :
    m.minFac > y ? ? p : ?, p.Prime -> p <= y -> ? p ? m := by
  constructor
  * intro h p hp hpy hdvd
    have := Nat.minFac_le_of_dvd hp.two_le hdvd
    omega
  * intro h
    by_contra hle
    exact h m.minFac (Nat.minFac_prime (by omega)) (by omega) (Nat.minFac_dvd m)

/-- `k` works for `n` iff no clock `p <= k^2 + 1` shows `n ? -k (mod p)`. -/
theorem works_iff {n k : ?} (h : 2 <= n + k) :
    (n + k).minFac > k ^ 2 + 1 ? ? p : ?, p.Prime -> p <= k ^ 2 + 1 -> ? p ? n + k :=
  minFac_gt_iff h

/-- A `k` with `n + k <= k^2 + 1` never works. -/
theorem not_works_of_large {n k : ?} (hk : k != 0) (h : n + k <= k ^ 2 + 1) :
    ? (n + k).minFac > k ^ 2 + 1 := by
  have := Nat.minFac_le (n := n + k) (by omega)
  omega

/-- Every even `n >= 2` is good, with `k = 1`. -/
theorem good_of_even {n : ?} (hn : Even n) (h2 : 2 <= n) : Good n := by
  refine ?1, one_ne_zero, ?_?
  have hodd : ? 2 ? n + 1 := by
    obtain ?m, rfl? := hn
    omega
  have hp := Nat.minFac_prime (n := n + 1) (by omega)
  have hne : (n + 1).minFac != 2 := fun h => hodd (h ? Nat.minFac_dvd (n + 1))
  have := hp.two_le
  norm_num
  omega

/-- A prime `p > n` with `(p - n)^2 + 1 < p` makes `n` good. -/
theorem good_of_prime {n p : ?} (hp : p.Prime) (h1 : n < p) (h2 : (p - n) ^ 2 + 1 < p) : Good n := by
  refine ?p - n, by omega, ?_?
  have : n + (p - n) = p := by omega
  rw [this, hp.minFac_eq]
  exact h2

/-- Conditional reduction: if every large `n` is followed by a prime `p` with `(p - n)^2 + 1 < p`
(prime gaps below about `sqrtp`), then the Formal Conjectures statement of part (i) holds. -/
theorem erdos_680_of_short_gaps
    (H : ?? (n : ?) in atTop, ? p : ?, p.Prime ? n < p ? (p - n) ^ 2 + 1 < p) :
    ?? (n : ?) in atTop, ? k != 0, (n + k).minFac > k ^ 2 + 1 := by
  filter_upwards [H] with n hn
  obtain ?p, hp, h1, h2? := hn
  exact good_of_prime hp h1 h2

/-- If `n` is bad, every prime `q > n` is far from `n`: `q <= (q - n)^2 + 1`. -/
theorem prime_far_of_bad {n q : ?} (h : ? Good n) (hq : q.Prime) (hn : n < q) : q <= (q - n) ^ 2 + 1 := by
  by_contra hlt
  exact h (good_of_prime hq hn (by omega))

/-- **Bad `n` lie in long prime gaps.** If `n` is bad and `p <= n < q` with `q` prime, then
`q <= (q - p)^2 + 1`, i.e. the gap `q - p` is at least `sqrt(q - 1)`. -/
theorem long_gap_of_bad {n p q : ?} (h : ? Good n) (hq : q.Prime) (hpn : p <= n) (hn : n < q) :
    q <= (q - p) ^ 2 + 1 := by
  have h1 := prime_far_of_bad h hq hn
  have h2 : (q - n) ^ 2 <= (q - p) ^ 2 := Nat.pow_le_pow_left (by omega) 2
  omega

/-! ## Finite checks -/

/-- no `d` with `2 <= d <= y` divides `m` -/
def noDiv (m y : ?) : Bool := (List.range (y + 1)).all fun d => d < 2 || m % d != 0

/-- some `d` with `2 <= d <= y` divides `m` -/
def hasDiv (m y : ?) : Bool := (List.range (y + 1)).any fun d => 2 <= d && m % d == 0

/-- some `1 <= k <= K` works for `n` -/
def goodB (n K : ?) : Bool := (List.range (K + 1)).any fun k => k != 0 && noDiv (n + k) (k ^ 2 + 1)

/-- every `1 <= k < B` fails for `n` -/
def badB (n B : ?) : Bool := (List.range B).all fun k => k == 0 || hasDiv (n + k) (k ^ 2 + 1)

theorem minFac_gt_of_noDiv {m y : ?} (hm : 2 <= m) (h : noDiv m y = true) : m.minFac > y := by
  rw [minFac_gt_iff hm]
  intro p hp hpy hdvd
  simp only [noDiv, List.all_eq_true, List.mem_range, Bool.or_eq_true, decide_eq_true_eq, bne_iff_ne] at h
  rcases h p (by omega) with h | h
  * have := hp.two_le
    omega
  * exact h (Nat.mod_eq_zero_of_dvd hdvd)

theorem minFac_le_of_hasDiv {m y : ?} (h : hasDiv m y = true) : m.minFac <= y := by
  simp only [hasDiv, List.any_eq_true, List.mem_range, Bool.and_eq_true, decide_eq_true_eq, beq_iff_eq] at h
  obtain ?d, hd, h2, hmod? := h
  have := Nat.minFac_le_of_dvd h2 (Nat.dvd_of_mod_eq_zero hmod)
  omega

theorem good_of_goodB {n K : ?} (hn : 1 <= n) (h : goodB n K = true) : Good n := by
  simp only [goodB, List.any_eq_true, List.mem_range, Bool.and_eq_true, bne_iff_ne] at h
  obtain ?k, -, hk, hd? := h
  exact ?k, hk, minFac_gt_of_noDiv (by omega) hd?

theorem not_good_of_badB {n B : ?} (hB : n <= B * (B - 1)) (h : badB n B = true) : ? Good n := by
  rintro ?k, hk, hgt?
  simp only [badB, List.all_eq_true, List.mem_range, Bool.or_eq_true, beq_iff_eq] at h
  by_cases hkB : k < B
  * rcases h k hkB with h | h
    * exact hk h
    * have := minFac_le_of_hasDiv h
      omega
  * refine not_works_of_large hk ?_ hgt
    have h1 : B * (B - 1) <= k * (k - 1) := Nat.mul_le_mul (by omega) (by omega)
    have h2 : k * (k - 1) + k = k ^ 2 := by
      cases k with
      | zero => exact absurd rfl hk
      | succ j => simp; ring
    omega

/-- The eight positive integers found by the search with no admissible `k`. -/
theorem bad_1 : ? Good 1 := not_good_of_badB (B := 2) (by decide) (by decide +kernel)
theorem bad_3 : ? Good 3 := not_good_of_badB (B := 3) (by decide) (by decide +kernel)
theorem bad_7 : ? Good 7 := not_good_of_badB (B := 4) (by decide) (by decide +kernel)
theorem bad_13 : ? Good 13 := not_good_of_badB (B := 5) (by decide) (by decide +kernel)
theorem bad_23 : ? Good 23 := not_good_of_badB (B := 6) (by decide) (by decide +kernel)
theorem bad_31 : ? Good 31 := not_good_of_badB (B := 7) (by decide) (by decide +kernel)
theorem bad_113 : ? Good 113 := not_good_of_badB (B := 12) (by decide) (by decide +kernel)
theorem bad_115 : ? Good 115 := not_good_of_badB (B := 12) (by decide) (by decide +kernel)

/-- `0` is bad as well (trivially). -/
theorem bad_0 : ? Good 0 := not_good_of_badB (B := 1) (by decide) (by decide +kernel)

def exc (n : ?) : Bool := n == 0 || n == 1 || n == 3 || n == 7 || n == 13 || n == 23 || n == 31 || n == 113 || n == 115

def checkBelow (N K : ?) : Bool := (List.range N).all fun n => exc n || goodB n K

theorem good_of_checkBelow {N K n : ?} (h : checkBelow N K = true) (hn : n < N) (he : exc n = false) :
    Good n := by
  simp only [checkBelow, List.all_eq_true, List.mem_range, Bool.or_eq_true] at h
  rcases h n hn with h | h
  * simp [he] at h
  * refine good_of_goodB ?_ h
    rcases n with _ | n
    * simp [exc] at he
    * omega

theorem check_20000 : checkBelow 20000 60 = true := by decide +kernel

/-- Below 20000 the bad `n` are exactly `0, 1, 3, 7, 13, 23, 31, 113, 115`. -/
theorem good_below_20000 {n : ?} (hn : n < 20000) (he : exc n = false) : Good n :=
  good_of_checkBelow check_20000 hn he

/-- 681: if `n + 1` is composite then `k = 1` works, so every bad `n` for 681 has `n + 1` prime. -/
theorem good681_of_succ_composite {n : ?} (h2 : 2 <= n + 1) (_h : ? (n + 1).Prime) :
    ? k > 0, ? (n + k).Prime ? 2 <= n + k ? (n + k).minFac > k ^ 2 := by
  refine ?1, one_pos, _h, h2, ?_?
  have := (Nat.minFac_prime (n := n + 1) (by omega)).two_le
  simp only [one_pow]
  omega

end Erdos680

#print axioms Erdos680.works_iff
#print axioms Erdos680.erdos_680_of_short_gaps
#print axioms Erdos680.long_gap_of_bad
#print axioms Erdos680.bad_115
#print axioms Erdos680.good_below_20000
#print axioms Erdos680.good_of_even
#print axioms Erdos680.good681_of_succ_composite
\end{Verbatim}

\section*{Sources}
\begin{enumerate}\small
  \item Erdős Problem \#680. \url{https://www.erdosproblems.com/680}
  \item Erdős Problem \#681. \url{https://www.erdosproblems.com/681}
  \item Formal Conjectures, ErdosProblems/680. \url{https://google-deepmind.github.io/formal-conjectures/FormalConjectures/ErdosProblems/680.html}
  \item Formal Conjectures, ErdosProblems/681. \url{https://google-deepmind.github.io/formal-conjectures/FormalConjectures/ErdosProblems/681.html}
  \item OEIS A389680. \url{https://oeis.org/A389680}
  \item Järviniemi, On large differences between consecutive primes, arXiv:2212.10965. \url{https://arxiv.org/abs/2212.10965}
  \item Lake project with the Lean proofs. \url{https://github.com/janjarosz05/0kwas}
  \item isitsolved Lean receipt 634fcf164b17 (accepted). \url{https://isitsolved.com/lean/receipts/634fcf164b17}
\end{enumerate}
\end{document}
