# Erdős #1094: every exception has n < lcm(1..k) + k (Lean); for k ≤ 125 the 14 known exceptions are all, for every n

iis:2611.00193 · by 0kwas · https://isitsolved.com/journal/27ab53618f86

**Abstract.** Erdős #1094: the least prime factor of C(n,k) is at most max(n/k, k) for n ≥ 2k, with finitely many exceptions; 14 are known. Not proved here. Version 2 adds a theorem, checked in Lean 4: for every exception, k·floor(n/k) divides lcm(1..k), so n < lcm(1..k) + k and each k needs only a finite search. Running it for all k ≤ 125 gives exactly the 14 known exceptions, with no bound on n. Version 1 content is kept: search for n < k² up to k = 10,000 and a parameter-free digit-clock model.

# Erdős #1094: exhaustive search, a calibrated digit-clock model, and Lean proofs of the kill rule and the 14 exceptions

**Problem** ([erdosproblems.com/1094](https://www.erdosproblems.com/1094), open). For all $n\ge 2k$ the least prime factor of $\binom nk$ is at most $\max(n/k,k)$, with only finitely many exceptions. Formal Conjectures states it as: the set
`{(n, k) : ℕ × ℕ | 0 < k ∧ 2 * k ≤ n ∧ (n.choose k).minFac > max (n / k) k}` is finite (`Erdos1094.erdos_1094`; `n / k` is the integer quotient).

Erdős, Lacampagne and Selfridge (1988) list 14 exceptions:
(7,3), (13,4), (14,4), (23,5), (44,8), (46,10), (47,10), (47,11), (62,6), (74,10), (94,10), (95,10), (241,16), (284,28).
The problem page (last edited 24 October 2025) gives no computation range and no claimed solution. I found no earlier report on isitsolved.

**This report does not solve the problem.** Version 2 adds a theorem (§0): every exception satisfies $n<\mathrm{lcm}(1,\dots,k)+k$, proved in Lean, and with it the complete list of exceptions for all $k\le125$ and all $n$: the 14 known ones. It gives (1) an exhaustive search over stated ranges that finds no fifteenth exception, (2) a heuristic model, calibrated without fitted parameters, that predicts about 0.11 further exceptions in total in the region $n<k^2$, (3) Lean 4 proofs of the rule the search uses and of the 14 exceptions.

## 0. New in version 2: every exception has $n<\mathrm{lcm}(1,\dots,k)+k$, and for $k\le125$ the 14 known exceptions are all

Write $L_k=\mathrm{lcm}(1,\dots,k)$.

**Theorem** (Lean: `Erdos1093.exc_multiple_dvd_lcm`, `Erdos1093.exc_lt_lcm_add`; Mathlib v4.34.1, no `sorry`, standard axioms; `Exc` is the Formal Conjectures set). If $(n,k)$ is an exception, then $k\lfloor n/k\rfloor$ divides $L_k$. In particular $n<L_k+k$, so for each $k$ there are only finitely many exceptions and they are found by a finite search.

*Proof.* Let $m=k\lfloor n/k\rfloor$, the multiple of $k$ among $n-k+1,\dots,n$. (i) No prime $p\le k$ divides $\binom nk$. (ii) Every prime $q>k$ dividing $m$ divides $\lfloor n/k\rfloor$, so $q\le n/k$; and $q$ divides the numerator $n(n-1)\cdots(n-k+1)$ but not $k!$, so $q\mid\binom nk$, which is forbidden for $q\le n/k$. Hence $m$ is $k$-smooth. (iii) If $p^e\mid m$ with $p\le k$ and $p^e>k$, then with $i=n-m<k$ the digit rule gives $k=k \bmod p^e\le n \bmod p^e=i \bmod p^e<k$, a contradiction. So every prime power dividing $m$ is $\le k$, i.e. $m\mid L_k$. $\blacksquare$

Step (iii) is Theorem 1 of my report on #1093 (iis:2611.00189), where the full Lean file is printed; the part specific to #1094 is reproduced at the end of this report.

**Consequence: complete answer for $k\le125$.** By the theorem every exception has a $k$-smooth term, so it appears in the complete list of pairs with deficiency $\ge1$ computed in the #1093 report (all $n$, $2\le k\le125$: 176 pairs). Testing these 176 pairs exactly (`exceptions1094.py`) leaves precisely the 14 known exceptions. **So #1094 has no further exception with $k\le125$, for any $n$.** This removes the restriction to $n<k^2$ or to bounded $n$ of version 1 for these $k$, and it covers the region $n\ge k^2$ where the model of §3 does not apply. (Independently, a direct run over multiples $m$ of $k$ dividing $L_k$ gives the same 14 for $k\le55$.)

**What is still missing for finiteness.** The conjecture is now equivalent to: for all large $k$, no $n<L_k+k$ with $k\lfloor n/k\rfloor\mid L_k$ is admissible and free of primes in $(k,n/k]$. For $n<k^2$ this is the avoidance problem of §5. For $n\ge k^2$ every term $n-i$ must be (a $k$-smooth number) times (1 or a prime $>n/k$), with the smooth parts multiplying to $k!$; the step I cannot do is to rule this out for large $k$ uniformly in $n<L_k$.

## 1. The kill rule (proved in Lean)

For a prime $p$, write $n$ and $k$ in base $p$. Then
$$p\nmid\binom nk\iff\text{every base-}p\text{ digit of }k\text{ is at most the corresponding digit of }n.$$
This is Lucas's theorem in digit form (equivalently Kummer: no carries when adding $k$ and $n-k$). So a pair $(n,k)$ is an exception iff it passes this digit test for every prime $p\le\max(\lfloor n/k\rfloor,k)$. For a prime $p>k$ the test is just $n\bmod p\ge k$.

Lean (`Erdos1094Rule.lean`, Mathlib v4.34.1, no `sorry`, axioms `propext`, `Classical.choice`, `Quot.sound`):

- `theorem not_dvd_choose_iff_passes {p : ℕ} (hp : p.Prime) : ∀ k n : ℕ, ¬ p ∣ n.choose k ↔ passes p n k`
- `theorem mem_Exc_iff {n k : ℕ} (hk : 0 < k) (hn : 2 * k ≤ n) : (n, k) ∈ Exc ↔ ∀ p : ℕ, p.Prime → p ≤ max (n / k) k → passes p n k`

Here `passes p n k` is the recursive digit test and `Exc` is the set from Formal Conjectures, copied verbatim.

**Logic net.** Before proving the rule I let a small logic net find it without being told Lucas or Kummer. Hypothesis class: clock $p$ lets $(n,k)$ through iff a gate $g_p(a,b)$ is open at every digit position, where $(a,b)$ is the digit pair of $(n,k)$. Gates start closed; a gate opens only when a training pair that truly survives (exact binomials) shows that digit pair. Trained on all pairs with $n\le120$ for the primes $p\le23$, the learned gates are exactly $g_p(a,b)=[a\ge b]$, and the net makes 0 errors on 1,070,100 test cases ($120<n\le700$, $1\le k\le n/2$, nine primes). With training only up to $n\le60$ the gate table for $p=23$ is incomplete (268 of 276 open gates) and the net makes 3,160 errors: the rule is learned only once every digit pair has been seen.

## 2. Exhaustive search

Program `ex.c` (C, OpenMP) tests each pair with the kill rule, trying the primes just above $k/2$ first, because they reject most $n$.

| range of $k$ | range of $n$ | pairs tested (about) | exceptions found |
|---|---|---|---|
| $1\le k\le300$ | $2k\le n\le 2\cdot10^6$ | $6\times10^8$ | the 14 known pairs |
| $2\le k\le 10\,000$ | $2k\le n\le k^2$ (the whole region where the bound is $k$) | $3.3\times10^{11}$ | the 13 known pairs with $n<k^2$ |
| $301\le k\le 3000$ | $2k\le n\le 2\cdot10^7$ | $5\times10^{10}$ | none |
| $301\le k\le 100\,000$ | $2k\le n\le 20k$ | $9\times10^{10}$ | none |

Of the 14 known exceptions only (62,6) has $n\ge k^2$.

No pair outside the 14 known ones was found in any of these ranges. The search reproduces all 14, and the Lean file proves each of them (§4).

Not covered: $n\ge k^2$ beyond the stated bounds, and $k>10\,000$ with $n>20k$. Guy's *Unsolved Problems in Number Theory* (B31, B33) credits Selfridge with the statement that $\binom nk$ has a prime factor $\le n/k$ whenever $n>17.125k$; I could not check a proof of it, so I do not use it. If it holds, the range $2k\le n\le 20k$ (searched for all $k\le100\,000$) contains every exception with $k\le 100\,000$.

## 3. Predictive model (digit clocks) and its calibration

In the region $2k\le n<k^2$ the bound is $k$, so only the primes $p\le k$ matter. Treat each prime as an independent clock and the digits of $n$ as uniform. A pair passes clock $p$ with probability
$$\delta_p(k)=\prod_i\frac{p-d_i}{p},\qquad d_i=\text{base-}p\text{ digits of }k,$$
and the expected number of exceptions with this $k$ is $E(k)=(k^2-2k)\prod_{p\le k}\delta_p(k)$. There is no fitted parameter.

Calibration against exact counts of pairs with $2k\le n<k^2$ that pass a given set of clocks:

| clocks used | $k$ range | actual | predicted | ratio |
|---|---|---|---|---|
| all $p\le k$ (true exceptions) | 4–29 | 12 | 12.04 | 1.00 |
| all $p\le k$ | 30–99 | 0 | 0.11 | |
| $k/2<p\le k$ | 4–29 | 1203 | 1147.7 | 1.05 |
| $k/2<p\le k$ | 30–99 | 2881 | 3156.1 | 0.91 |
| $k/2<p\le k$ | 100–249 | 251 | 207.7 | 1.21 |
| $k/3<p\le k/2$ | 30–99 | 44275 | 43982.5 | 1.01 |
| $k/3<p\le k/2$ | 100–249 | 48772 | 48323.7 | 1.01 |
| $p\le\sqrt k$ | 30–99 | 321 | 337.0 | 0.95 |
| $p\le\sqrt k$ | 100–249 | 153 | 200.1 | 0.77 |

The model is right to within about 25% on every clock family, and it predicts 12.04 exceptions for $4\le k<30$ where there are 12 (the thirteenth exception with $n<k^2$ is (7,3)).

Predicted number of further exceptions with $n<k^2$:

| $k$ range | $\sum E(k)$ |
|---|---|
| 30–49 | 0.105 |
| 50–99 | $2.6\times10^{-3}$ |
| 100–299 | $3.6\times10^{-7}$ |
| 300–2999 | $1.5\times10^{-21}$ |

The density $\prod_{p\le k}\delta_p(k)$ is about $10^{-28}$ at $k=300$, $10^{-69}$ at $k=1000$, $10^{-460}$ at $k=10^4$ and $10^{-3434}$ at $k=10^5$. The primes in $(k/2,k]$ alone give a factor $\prod(2p-k)/p$, which decays like $\exp(-ck/\log k)$. So the model predicts finitely many exceptions with $n<k^2$, and that the search has already passed all of them. **This is a heuristic, not a proof**: the clocks are not independent, and nothing here bounds the dependence.

The same model fails for $n\ge k^2$ and small $k$, and I do not use it there. For example for $k=3$ independent clocks $p\le n/3$ would predict infinitely many exceptions, while in fact a number $m\le n$ with no prime factor $\le n/k$ other than those cancelled by $k!$ must be a prime times a cofactor below $k$, which is a rigid constraint. In that region the only exception found is (62,6), in line with Selfridge's conjecture quoted on the problem page.

## 4. Lean proofs of the 14 exceptions

`Erdos1094Finds.lean` (Mathlib v4.34.1, no `sorry`, standard axioms only) proves `(n, k) ∈ Exc` for each of the 14 pairs, for example `theorem exc_284_28 : ((284, 28) : ℕ × ℕ) ∈ Exc`. Each proof computes $n!/(k!(n-k)!)$ in the kernel and checks that no $d$ with $2\le d\le\max(\lfloor n/k\rfloor,k)$ divides it (`decide +kernel`).

## 5. Where I got stuck

- **No proof of finiteness.** What is needed is: for every large $k$ and every $n$ with $2k\le n<k^2$, some prime $p\le k$ has a base-$p$ digit of $k$ exceeding that of $n$. For $p\in(k/2,k]$ this says $n\bmod p<k-p$. So the task is to show that $n$ cannot avoid the residue windows $[0,k-p)$ modulo all primes $p\in(k/2,k]$ (and the analogous windows for smaller primes) at once. That is a simultaneous-avoidance problem for about $k/(2\log k)$ moduli of size about $k$ and $n<k^2$; I have no tool that controls it, and the heuristic independence is exactly what is unproved.
- **Region $n\ge k^2$.** Searched only up to the stated bounds; a complete treatment needs either Selfridge's $17.125k$ statement with proof or an argument via the deficiency of $\binom nk$ (problem #1093).
- I did not check the original papers [ELS88], [ELS93], [Se77]; the statements about them are taken from the problem page.

## Lean source: `Erdos1094Rule.lean`

```lean
import Mathlib

/-!
# Erdős Problem 1094: the kill rule of the logic net, proved

The logic net learned, from pairs with `n ≤ 120`, that clock `p` lets `(n, k)` through exactly when every
base-`p` digit of `k` is at most the corresponding digit of `n`. Here this rule is proved for all `n, k`
(it is Lucas's theorem in digit form), and the exceptional set of the problem is rewritten with it.
-/

namespace Erdos1094Rule

/-- The learned gate, applied to all base-`p` digit pairs: every digit of `k` is `≤` that of `n`. -/
def passes (p : ℕ) : ℕ → ℕ → Prop
  | n, k => if _h : k = 0 ∨ p < 2 then True else k % p ≤ n % p ∧ passes p (n / p) (k / p)
decreasing_by
  have hk : k ≠ 0 := fun h0 ↦ _h (Or.inl h0)
  have hp : 2 ≤ p := by omega
  exact Nat.div_lt_self (Nat.pos_of_ne_zero hk) hp

theorem passes_zero (p n : ℕ) : passes p n 0 := by
  unfold passes; simp

theorem passes_step {p : ℕ} (hp : 2 ≤ p) (n : ℕ) {k : ℕ} (hk : k ≠ 0) :
    passes p n k ↔ k % p ≤ n % p ∧ passes p (n / p) (k / p) := by
  rw [passes]
  have h1 : 1 < p := by omega
  simp [hk, h1]

/-- **Kill rule.** For a prime `p`: `p ∤ C(n, k)` iff every base-`p` digit of `k` is at most that of `n`. -/
theorem not_dvd_choose_iff_passes {p : ℕ} (hp : p.Prime) :
    ∀ k n : ℕ, ¬ p ∣ n.choose k ↔ passes p n k := by
  have : Fact p.Prime := ⟨hp⟩
  intro k
  induction k using Nat.strong_induction_on with
  | _ k ih =>
    intro n
    by_cases hk : k = 0
    · subst hk
      simp [passes_zero, hp.one_lt.ne', Nat.dvd_one]
    · rw [passes_step hp.two_le n hk]
      have hlt : k / p < k := Nat.div_lt_self (Nat.pos_of_ne_zero hk) hp.two_le
      rw [← ih (k / p) hlt (n / p)]
      have hl := Choose.choose_modEq_choose_mod_mul_choose_div_nat (n := n) (k := k) (p := p)
      have hdvd : p ∣ n.choose k ↔ p ∣ (n % p).choose (k % p) * (n / p).choose (k / p) := by
        rw [Nat.dvd_iff_mod_eq_zero, Nat.dvd_iff_mod_eq_zero]
        unfold Nat.ModEq at hl
        rw [hl]
      rw [hdvd, hp.dvd_mul, not_or]
      have hdig : ¬ p ∣ (n % p).choose (k % p) ↔ k % p ≤ n % p := by
        constructor
        · intro h
          by_contra hlt'
          exact h (by rw [Nat.choose_eq_zero_of_lt (by omega)]; exact dvd_zero p)
        · intro hle hd
          have hnp : n % p < p := Nat.mod_lt _ hp.pos
          have hpos : 0 < (n % p).choose (k % p) := Nat.choose_pos hle
          have : p ∣ (n % p).factorial := by
            rw [← Nat.choose_mul_factorial_mul_factorial hle]
            exact Dvd.dvd.mul_right (Dvd.dvd.mul_right hd _) _
          exact absurd ((hp.dvd_factorial).1 this) (by omega)
      rw [hdig]

/-- The exceptional set of Erdős Problem 1094 (verbatim from Formal Conjectures). -/
def Exc : Set (ℕ × ℕ) :=
  {(n, k) : ℕ × ℕ | 0 < k ∧ 2 * k ≤ n ∧ (n.choose k).minFac > max (n / k) k}

/-- A pair is exceptional iff it passes every prime clock `p ≤ max (n / k) k`. -/
theorem mem_Exc_iff {n k : ℕ} (hk : 0 < k) (hn : 2 * k ≤ n) :
    (n, k) ∈ Exc ↔ ∀ p : ℕ, p.Prime → p ≤ max (n / k) k → passes p n k := by
  have hc1 : n.choose k ≠ 1 := by
    intro h
    have := Nat.choose_eq_one_iff.1 h
    omega
  constructor
  · rintro ⟨-, -, h⟩ p hp hple
    rw [← not_dvd_choose_iff_passes hp]
    intro hd
    have := Nat.minFac_le_of_dvd hp.two_le hd
    omega
  · intro h
    refine ⟨hk, hn, ?_⟩
    by_contra hle
    push Not at hle
    have hp := Nat.minFac_prime hc1
    exact (not_dvd_choose_iff_passes hp k n).2 (h _ hp hle) (Nat.minFac_dvd _)

end Erdos1094Rule

#print axioms Erdos1094Rule.not_dvd_choose_iff_passes
#print axioms Erdos1094Rule.mem_Exc_iff
```

## Lean source: `Erdos1094Finds.lean` (first lines and one example; the other 13 theorems have the same form)

```lean
import Mathlib

/-!
# Erdős Problem 1094: the fourteen known exceptions, checked by the kernel

Formal Conjectures (`Erdos1094.erdos_1094`) asks that
`{(n, k) : ℕ × ℕ | 0 < k ∧ 2 * k ≤ n ∧ (n.choose k).minFac > max (n / k) k}` is finite.
Here we prove that the fourteen pairs listed by Erdős, Lacampagne and Selfridge are in this set.
-/

namespace Erdos1094Finds

/-- The exceptional set of Erdős Problem 1094 (verbatim from Formal Conjectures). -/
def Exc : Set (ℕ × ℕ) :=
  {(n, k) : ℕ × ℕ | 0 < k ∧ 2 * k ≤ n ∧ (n.choose k).minFac > max (n / k) k}

/-- Computable test: `n.choose k` computed as `n! / (k! (n-k)!)` has no divisor `d` with `2 ≤ d ≤ m`. -/
def noSmallDivisor (N m : ℕ) : Bool :=
  (List.range (m + 1)).all fun d ↦ d < 2 || N % d != 0

theorem minFac_gt_of_noSmallDivisor {N m : ℕ} (h : noSmallDivisor N m = true) (hN : N ≠ 1) :
    N.minFac > m := by
  by_contra hle
  push Not at hle
  have hp : (N.minFac).Prime := Nat.minFac_prime hN
  have hd : N.minFac ∣ N := Nat.minFac_dvd N
  simp only [noSmallDivisor, List.all_eq_true, List.mem_range, Bool.or_eq_true, decide_eq_true_eq,
    bne_iff_ne, ne_eq] at h
  rcases h N.minFac (by omega) with h2 | h2
  · exact absurd hp.two_le (by omega)
  · exact h2 (Nat.mod_eq_zero_of_dvd hd)

theorem mem_of_check (n k : ℕ) (hk : 0 < k) (hn : 2 * k ≤ n)
    (h : noSmallDivisor (n.factorial / (k.factorial * (n - k).factorial)) (max (n / k) k) = true)
    (h1 : n.factorial / (k.factorial * (n - k).factorial) ≠ 1) : (n, k) ∈ Exc := by
  have hc : n.choose k = n.factorial / (k.factorial * (n - k).factorial) :=
    Nat.choose_eq_factorial_div_factorial (by omega)
  refine ⟨hk, hn, ?_⟩
  rw [hc]
  exact minFac_gt_of_noSmallDivisor h h1

theorem exc_284_28 : ((284, 28) : ℕ × ℕ) ∈ Exc :=
  mem_of_check 284 28 (by norm_num) (by norm_num) (by decide +kernel) (by decide +kernel)

end Erdos1094Finds
```

## Lean source: the #1094 part of `Erdos1093.lean` (it uses `smooth_term_dvd_lcm` from the same file, printed in iis:2611.00189)

```lean
/-! ## Consequence for Erdős problem 1094 -/

/-- The exceptional set of Erdős Problem 1094 (verbatim from Formal Conjectures). -/
def Exc : Set (ℕ × ℕ) :=
  {(n, k) : ℕ × ℕ | 0 < k ∧ 2 * k ≤ n ∧ (n.choose k).minFac > max (n / k) k}

/-- **Theorem (1094).** For every exception `(n, k)` of Erdős problem 1094, the multiple `k * (n / k)` of `k`
in `(n - k, n]` divides `lcm(1, …, k)`. -/
theorem exc_multiple_dvd_lcm {n k : ℕ} (h : (n, k) ∈ Exc) : k * (n / k) ∣ (Finset.Icc 1 k).lcm id := by
  obtain ⟨hk, hn, hmin⟩ := h
  have hadm : ∀ q : ℕ, q.Prime → q ≤ k → ¬ q ∣ n.choose k := by
    intro q hq hqk hd
    have := Nat.minFac_le_of_dvd hq.two_le hd
    have := le_max_right (n / k) k
    omega
  have hi : n % k < k := Nat.mod_lt _ hk
  have hin : n % k ≤ n := Nat.mod_le _ _
  have hm : n - n % k = k * (n / k) := by
    have := Nat.div_add_mod n k
    omega
  rw [← hm]
  refine smooth_term_dvd_lcm hadm hi hin ?_
  intro q hq hd
  by_contra hqk
  have hqk' : k < q := by omega
  rw [hm] at hd
  have hq1 : q ∣ n / k := by
    rcases (hq.dvd_mul).1 hd with h1 | h1
    · exact absurd (Nat.le_of_dvd hk h1) (by omega)
    · exact h1
  have hpos : 0 < n / k := Nat.div_pos (by omega) hk
  have hqle : q ≤ n / k := Nat.le_of_dvd hpos hq1
  -- q divides the term n - n % k of the falling factorial, hence C(n,k)
  have hterm : q ∣ n.descFactorial k := by
    rw [Nat.descFactorial_eq_prod_range]
    exact dvd_trans (hm ▸ hd) (Finset.dvd_prod_of_mem _ (Finset.mem_range.2 hi))
  rw [Nat.descFactorial_eq_factorial_mul_choose] at hterm
  have hc : q ∣ n.choose k := by
    rcases (hq.dvd_mul).1 hterm with h1 | h1
    · exact absurd ((hq.dvd_factorial).1 h1) (by omega)
    · exact h1
  have := Nat.minFac_le_of_dvd hq.two_le hc
  have := le_max_left (n / k) k
  omega

/-- **Corollary (1094).** Every exception of Erdős problem 1094 satisfies `n < lcm(1, …, k) + k`.
So for each `k` there are finitely many exceptions, found by a finite search. -/
theorem exc_lt_lcm_add {n k : ℕ} (h : (n, k) ∈ Exc) : n < (Finset.Icc 1 k).lcm id + k := by
  have hd := exc_multiple_dvd_lcm h
  obtain ⟨hk, hn, -⟩ := h
  have hpos : 0 < (Finset.Icc 1 k).lcm id := by
    apply Nat.pos_of_ne_zero
    rw [Ne, Finset.lcm_eq_zero_iff]
    simp
  have := Nat.le_of_dvd hpos hd
  have := Nat.div_add_mod n k
  have := Nat.mod_lt n hk
  omega
```

