# Erdős #647: m + τ(m) and the next integer

## The question

Problem #647 ([erdosproblems.com/647](https://www.erdosproblems.com/647)), due to Erdős and Selfridge: is there an n > 24 with max over m < n of (m + τ(m)) ≤ n + 2? Here τ(m) is the number of divisors of m. Erdős offered 25 pounds for an example. Writing m = n − k, the condition is

  τ(n − k) ≤ k + 2 for every k = 1, ..., n − 1.  (∗)

The numbers n = 1, 2, 3, 4, 5, 6, 8, 10, 12 and 24 satisfy it.

## Why it matters

It asks whether the divisor function can stay small enough, just below an integer, for all smaller numbers at once; the forum has ruled out every n up to very large bounds, so any example would be very large.

## What answering it would help with

An example, or a proof that none exists, would determine whether the divisor function can stay within the stated limits on runs of consecutive integers; separate replications give cross-checks on the forum's searches.

## What our research shows

We stand on the shoulders of giants. This chapter is a replication of work already on the forum, in a smaller range than the forum reports. The credits page lists the sources.

### What the forum reports

As read through a page reader; the fragments were not checked against the raw pages, and handles are as shown there.

- Dutta (January 2026): divisibility filters (rules that rule out whole families of n) ending in n = 2520N. Alexeev: a repair of one step, and the observation that 2520N − 1 is then prime. Kitamura: (n − 3)/3 is prime for n > 84.
- Hughes (May to June 2026): a reduction to 41 residue classes (numbers grouped by their remainder on division by 46189) modulo 46189, density bounds, a search to about 6.16 × 10^17 and a certificate (a file that lets a reader check the claim) for no solution with 24 < n ≤ 615,736,321,200,000,000. With bentrd, a frontier of about 9.17 × 10^18 (second-hand: no bentrd comment was visible on the page as read).
- Idén (June 2026): no solution in (24, 10^12]; the comment cites an earlier bound of 10^10 in OEIS A087280 (the On-Line Encyclopedia of Integer Sequences, a public catalogue of number sequences).
- IbbyMian: a Lean 4 proof (Lean is a program that checks every step of a proof against fixed rules) to 10^8. eerot (October 2026): a kernel-checked exclusion (every step passed Lean's small core checker) to 10^13.
- Mian and Siddique (arXiv:2608.17880, August 2026): a Lean 4 proof, using only the three standard axioms, that no n with 24 < n ≤ 10^9 satisfies the condition. The range of this chapter ends at 10^14 and is computed; no Lean proof ships with it.
- veljjanoski (September 2026): GPU searches (run on graphics cards, which do many small calculations at once) to 10^20 and then 10^22, without a certificate.

Our search stops at 10^14. It lies inside what Hughes reports with a certificate and beyond eerot's Lean-checked 10^13. It is a replication, with separate code, separate proofs and a separate log, and it does not extend any of these ranges.

### Result

**The question answered here.** Is there an n above 24, up to 10^14, for which m + τ(m) stays at most n + 2 for every m below n?

**No n with 24 < n ≤ 10^14 satisfies (∗).** Together with the brute force (trying every number) up to 6,350,464 (the threshold of the residue lemma below), the solutions in [1, 10^14] are exactly the ten numbers above. A direct computation of every n ≤ 10^8, which does not use the residue lemma, gives the same ten numbers: it was done in C and done again with a separately written program.

### The argument (all elementary)

**Lemma 1 (lower bound).** Let S be a finite set of primes, and write m = d·c where d is the part of m made of primes in S and c is coprime to them. Then τ(m) = τ(d)·τ(c), because τ is multiplicative, and τ(c) = 1 if c = 1, τ(c) = 2 if c is prime, τ(c) ≥ 3 if c is composite. So knowing the exact exponents of the primes in S gives a lower bound on τ(m).

**Lemma 2 (residue lemma; it recovers the reduction of Dutta and Alexeev).** Let M = 2^6·3^4·5^2·7^2 = 6,350,400 and K = 64. Suppose n ≡ r mod M and n > M + K. For each k ≤ K and each prime power p^a exactly dividing M, put t = (r − k) mod p^a. If t ≠ 0 then the exponent of p in n − k is exactly the exponent of p in t. If t = 0 it is at least a. This gives a lower bound b(r, k) for the product of (exponent + 1) over p = 2, 3, 5, 7. When all four exponents are exact, the {2,3,5,7}-part of n − k is less than M < n − k, so n − k has another prime factor and b may be doubled (Lemma 1). If b(r, k) > k + 2 for some k ≤ 64, no n in the class r satisfies (∗). The classes that survive are 2205 in number, and all of them are multiples of 2520, which matches the published reduction. They can be recomputed in a few lines; the check recipe says how.

**Lemma 3 (the filter at k = 1, 2; the observation of Alexeev and Dutta on the forum, written out in elementary form).** If n > 10 satisfies (∗) then n − 1 is prime and (n − 2)/2 is prime. *Proof.* From k = 1, τ(n − 1) ≤ 3, so n − 1 is 1, a prime or a prime square. If n were odd, n − 1 would be an even prime or the square of one, so n ≤ 5. So n is even and n − 2 is even. From k = 2, τ(n − 2) ≤ 4. If 4 divides n − 2, write n − 2 = 2^a·u with u odd; then (a + 1)·τ(u) ≤ 4 forces u = 1 and a ≤ 3, so n ≤ 10. So 4 divides n and n − 2 = 2u with u odd and 2τ(u) ≤ 4, so u is 1 or prime, and u = 1 gives n = 4. Now n − 1 ≡ 3 mod 4, and an odd square is 1 mod 4, so n − 1 is prime (this last step is Alexeev's: 2520N − 1 is 3 mod 4, so it cannot be a square). ∎

**Lemma 4 (soundness of the sieve).** The C sieve (a program, written in C, that strikes out numbers in bulk) that produced the logs for n above 10^8 works on n = r + M·j. For each of the 2205 classes and each k ≤ 64 it removes every prime power p^e ≤ n with p ≤ 65536 from n − k exactly, so the exponent of every such p is exact. What is left, the cofactor c, has only prime factors above 65536. It is prime when it is below 65536², and a deterministic Miller-Rabin test (a quick way to tell whether a number is prime) decides it otherwise (the base sets of Sorenson and Webster are deterministic far beyond 10^14). Lemma 1 then gives a lower bound on τ(n − k), and discarding n when that bound exceeds k + 2 can never discard a true solution.

**Lemma 5 (finitely many k suffice).** Let T(x) be the largest τ(m) for m ≤ x. If τ(n − k) ≤ k + 2 for all k ≤ T(n) − 2, then (∗) holds for all k, since τ(n − k) ≤ T(n) ≤ k + 2 beyond that. T(x) can be computed rigorously from the exponent patterns of highly composite numbers. No survivor of the sieve ever arose, so this lemma was only used on test inputs.

### Coverage

The sieve ran in chunks. Its output lists, for every class and chunk, the number of candidates n and the number left after each stage. The check recipe says how to read it. A reader checks that every one of the 2205 classes appears exactly once in each chunk, that each class's candidate count equals the exact number of integers n ≡ r (mod M) in the chunk, that the chunks are contiguous from 10^8 + 1 to 10^14, and that no chunk lists a survivor.

| range | candidates | survivors |
|---|---|---|
| (10^8, 10^10] | 3,437,500 | 0 |
| (10^10, 10^12] | 343,750,000 | 0 |
| (10^12, 10^13] | 3,125,000,000 | 0 |
| (10^13, 3·10^13] | 6,944,444,444 | 0 |
| (3·10^13, 10^14] | 24,305,555,556 | 0 |
| total | 34,722,187,500 | 0 |

Every candidate was removed by the lower-bound sieve (stage 1), so the later stages (Miller-Rabin and two exact τ programs) never met a production value.

### What the bundle re-establishes by running, and what it does not

- Run here with Python programs of our own: the residue lemma (the 2205 classes); a brute-force computation for n ≤ 6,350,464, which finds exactly the ten numbers; an arithmetic scan of every candidate n up to 10^9 in the 2205 classes, written independently of the C sieve, with no survivors; and the coverage check of the shipped logs. The programs are not part of this book; the recipe in the verification guide gives what to test.
- A direct computation for every n ≤ 10^8, with τ(m) for all m ≤ 10^8 from a divisor-count sieve and no use of the residue lemma: done in C (about 8 seconds on one core) and again by a separately written program (about 16 seconds). Both find exactly the ten numbers 1, 2, 3, 4, 5, 6, 8, 10, 12 and 24.
- Not re-run: the C sieve itself for n above 10^9. For that range the bundle ships the logs and checks their bookkeeping. The C sources are available on request.
- The search is finite. It says nothing about n above 10^14.

### Yesterday, today, tomorrow

**Yesterday.** Erdős and Selfridge asked whether any n above 24 has the property that m plus the number of divisors of m stays at most n plus 2 for every m below n. On the forum, Dutta, Alexeev and Kitamura found filters that reduce the search; Hughes reduced it to 41 residue classes and searched to about 6.16 x 10^17 with a certificate; Idén reported no solution up to 10^12; IbbyMian and eerot gave Lean-checked exclusions to 10^8 and 10^13; and veljjanoski searched to 10^22 without a certificate.

**Today.** This chapter is a replication, in a smaller range than the forum reports, with separate code, proofs and logs. I recomputed the residue lemma (2205 classes, all multiples of 2520), found by brute force that the solutions up to 6,350,464 are exactly the ten numbers 1, 2, 3, 4, 5, 6, 8, 10, 12 and 24 (a direct computation up to 10^8, done twice by separately written programs, finds the same ten), and ran an arithmetic scan to 10^9 with no survivors. For 10^8 to 10^14 the bookkeeping of the sieve logs was checked (34,722,187,500 candidates, none surviving); the sieve itself was not rerun above 10^9. It extends none of the forum's ranges and says nothing above 10^14.

**Tomorrow.** The separate code and logs may serve as a cross-check for people comparing searches on the forum. The elementary lemmas are short enough to reuse in other searches of this kind.

## Check it yourself

The recipe for problem 647 in the [verification guide](../VERIFY.md) recomputes the residue classes, the brute force and the scan, and checks the bookkeeping of the shipped sieve logs.

## Where to go next

- How do the exhaustive searches for problem 64 reach their bound, and why do they stop at 22 vertices? See the [chapter on problem 64](01-erdos-64.md).
- How can you check the sieve logs yourself? See the [recipe for problem 647](../VERIFY.md).
