Erdős #647: literature bound 1022 (OEIS), independent search to 109, and a Lean-checked structure theorem (24 | n, (n−2)/2 prime) for any solution
Erdős #647 asks for an n > 24 with max over m < n of m + τ(m) at most n + 2. OEIS A087280 already records that no such n exists up to 1022 (Sep 2026), a bound missing from erdosproblems.com. We confirm independently that none exists in (24, 109]. We also prove in Lean that any solution has 24 | n with (n−2)/2 prime, and we explain why neither a proof nor a disproof is in reach.
Erdős asked whether a certain lucky number exists, one just past a run of numbers that all have few divisors. Computers have already ruled out everything below 1022. We double-checked part of that, proved with a proof checker that any such number must be a multiple of 24 with special neighbours, and explain why settling the question seems out of reach.
Problem (erdosproblems.com/647, prize £25; Lean statement Erdos647.erdos_647). Is there an \(n>24\) with$$\max_{m<n}\big(m+\tau(m)\big)\le n+2\,?$$
1. Literature check
- The known solutions are \(n=5,8,10,12,24\) (OEIS A087280).
- OEIS A087280 records that no further terms exist up to \(10^{10}\), then up to \(10^{12}\) (P. Idén, Jun 2026), then up to \(10^{22}\) (D. Veljjanoski, Sep 2026).
- The erdosproblems page (last edited 7 Apr 2026) gives no computational bound, so this bound is worth recording.
2. Independent computation
Let \(g(n)=\max_{m<n}(m+\tau(m))-n\). Then \(g(n+1)=\max(g(n)-1,\ \tau(n)-1)\). A linear scan with a segmented divisor sieve (e647.c) returns:
- exactly \(\{2,3,4,5,6,8,10,12,24\}\) for \(g(n)\le 2\) with \(n<100\);
- no solution in \((24,10^9]\).
A necessary "window" condition is \(\tau(n-j)\le j+2\) for \(j=1,\dots,J\). The counts for \(n\in(30,10^9]\) are:
| \(J\) | count |
|---|---|
| 5 | 760 |
| 6 | 45 |
| 7 | 19 |
| 8 | 5 |
| 9 | 1 (\(n=629992440\)) |
| 10 | 0 |
For \(J=1,\dots,4\) and \(n\le 10^8\) the counts are \(5762671\), \(229564\), \(20600\) and \(975\).
3. Structure of any solution (checked in Lean)
Theorem (Erdos647Structure.witness_structure). If \(n>24\) satisfies the official Lean statement's condition \(\bigsqcup_{m:\mathrm{Fin}\,n} m+\sigma_0(m)\le n+2\), then \(24\mid n\) and \((n-2)/2\) is prime.
The Lean proof depends only on the axioms propext, Classical.choice and Quot.sound, and it uses only \(m=n-1, n-2, n-4\):
- \(n\) is even. Otherwise \(n-1=2k\) has the four divisors \(1,2,k,2k\).
- \(n-2=2k\) with \(k\) odd and prime. Otherwise \(\{1,2,4,k,2k\}\) or \(\{1,2,a,k,2k\}\) are five divisors.
- \(3\nmid n-1\), and \(3\nmid n-2\) (otherwise \(k=3\)). Hence \(3\mid n\).
- \(n-4=4j\) with \(j\) odd. Otherwise \(\{1,2,4,8,j,2j,4j\}\) are seven divisors. The exceptional case \(n=36\) dies at \(m=35\).
A brute-force check over \(n\in(24,2\cdot10^6]\) confirms the sharper necessary forms: \(n-1\) is a prime or a prime square, \(n-3=3p\), and \(n-4=4p\).
4. Dead ends
- Non-existence. A proof would need to show that the constellation \(n-1\in P\cup P^2\), \(n-2=2p\), \(n-3=3p'\), \(n-4=4p''\), \(\dots\) never occurs together with \(\tau(n-j)\le j+2\) for all \(j\). Congruence arguments exclude only a few residues per condition and cannot do this. Erdős notes that the windowed version would follow from Schinzel's Hypothesis H, and Tao compares the problem to the first part of #679.
- Existence. A search is no longer promising: the candidate density falls like \((\log X)^{-k}\) with growing \(k\), and the bound is already \(10^{22}\).
This note does not resolve the problem. Its contributions are the literature bound, an independent check, and a Lean-checked structure theorem for any solution.
Disclosure. This work was done by Rotem Ashkenazi with Claude (Anthropic). Code and Lean: github.com/rotem4997/lean-classics/tree/main/investigations/erdos-647