Zaremba’s Conjecture: 210 Billion Verified on 8× NVIDIA B200
Abstract
We verify Zaremba’s Conjecture for all from 1 to 210 billion using GPU-accelerated continued fraction tree enumeration across 8 NVIDIA B200 GPUs. The v6 multi-pass kernel completes in 116 minutes with zero failures. Combined with spectral analysis (congruence transfer operator gaps uniform across 1,214 square-free moduli), an algebraic transitivity proof (Γ generates SL₂ for ALL primes via Dickson’s classification), Cayley graph diameters (diam(p) ≤ 2·log(p) for 669 primes), and 19/20 machine-verified Lean 4 proofs from a dual-model LLM race, this is the most comprehensive computational attack on Zaremba’s Conjecture to date.
Background
Zaremba’s Conjecture (1972): For every positive integer , there exists an integer with such that the continued fraction expansion
has all partial quotients .
This conjecture has been open for over 50 years. The strongest partial result is due to Huang (2015), who proved it holds for a density-1 subset of positive integers — meaning almost all satisfy the conjecture, but infinitely many exceptions could theoretically remain.
The gap between “almost all” and “all” is one of the fundamental difficulties in analytic number theory, analogous to the gap between the known density results for Goldbach’s conjecture and the conjecture itself.
Hardware
| Component | Specification |
|---|---|
| Node | NVIDIA DGX B200 |
| GPUs | 8× NVIDIA B200 (183 GB VRAM each) |
| Total VRAM | 1.43 TB |
| GPU Interconnect | NVLink 5 (NV18), full mesh |
| NVLink Bandwidth | 18 links × 53.125 GB/s = 956 GB/s per GPU |
| CPUs | 2× Intel Xeon Platinum 8570 (56 cores each) |
| Total Cores/Threads | 112 / 224 |
| System RAM | 2 TB DDR5 |
| Storage | 28 TB NVMe |
Method
Part 1: LLM-Assisted Formal Proving
We formalized Zaremba’s Conjecture in Lean 4, creating 20 theorem statements for with bound . Each theorem has the form:
theorem zaremba_d7 : HasZarembaWitness 7 5 := by sorry
where HasZarembaWitness d A asserts:
We served two SOTA proving models on split GPU sets:
| Model | HF ID | Parameters | GPUs | Port |
|---|---|---|---|---|
| Goedel-Prover-V2-32B | Goedel-LM/Goedel-Prover-V2-32B | 32B (Qwen3) | 0–3 | 8000 |
| Kimina-Prover-72B | AI-MO/Kimina-Prover-72B | 72B (Qwen2.5) | 4–7 | 8001 |
Both served via vLLM 0.18.0 with 4-way tensor parallelism. Our prover harness queries both servers in parallel; the first valid proof wins. Each proof is verified by the Lean 4 compiler.
The proof pattern for each theorem is:
exact ⟨WITNESS, by decide, by decide, by native_decide, by native_decide⟩
where WITNESS is a concrete integer and native_decide compiles the verification to native code.
Part 2: CUDA-Accelerated Exhaustive Verification
We wrote a custom CUDA kernel (zaremba_verify_v2.cu) where each CUDA thread handles one value of . The kernel went through two iterations:
v1 searched linearly — this worked for small but hit a scaling wall at (199 d/sec at , projected weeks for the full range).
v2 uses our witness distribution discovery () to dramatically narrow the search:
__device__ uint64_t find_witness_v2(uint64_t d) {
// Phase 1: Spiral outward from 0.170*d in [0.165d, 0.185d]
uint64_t center = (uint64_t)(0.170 * (double)d);
for (uint64_t offset = 0; offset <= band_width; offset++) {
uint64_t a = center + offset; // also try center - offset
if (!quick_coprime(a, d)) continue; // skip obvious non-coprimes
if (dev_gcd(a, d) != 1) continue;
if (cf_bounded(a, d)) return a;
}
// Phase 2-3: wider search, then full search (rarely needed)
...
}
Key optimizations in v2:
- Targeted search: Start at and spiral outward — hits the witness in a band of width of for 99% of cases
- Coprimality sieve: Skip candidates sharing small factors (2, 3, 5, 7, 11, 13) with before computing the full gcd
- CF prefix filter: Check if before running the full CF expansion
Benchmark (100K values at , single GPU):
| Kernel | Rate | Time |
|---|---|---|
| v1 | 199 d/sec | 503s |
| v2 | 2,612 d/sec | 38s |
| Speedup | 13× |
We launched 8 parallel instances, one per GPU:
| GPU | Range | Values |
|---|---|---|
| 0 | to | |
| 1 | to | |
| … | … | … |
| 7 | to |
Part 3: Transfer Operator Spectral Analysis
To move beyond brute-force verification toward a potential proof, we computed the spectral properties of the Gauss-type transfer operator for CFs bounded by :
The Hausdorff dimension of the set (reals with all CF quotients ) is the unique where the spectral radius of equals 1. If , the circle method (Bourgain-Kontorovich style) can in principle be applied.
We discretized using Chebyshev collocation with points on , converting the eigenvalue problem into a dense matrix eigensolve computed on GPU via cuSOLVER.
Results
LLM Proving Race: 19/20
| Winner | Witness | Winner | Witness | ||
|---|---|---|---|---|---|
| 1 | Goedel | 1 | 11 | Kimina | 2 |
| 2 | Goedel | 1 | 12 | Goedel | 5 |
| 3 | Goedel | 1 | 13 | Kimina | 3 |
| 4 | Goedel | 1 | 14 | Goedel | 3 |
| 5 | Goedel | 1 | 15 | Kimina | 4 |
| 6 | Kimina | 5 | 16 | Goedel | 3 |
| 7 | Kimina | 2 | 17 | Kimina | 3 |
| 8 | Kimina | 3 | 18 | Goedel | 5 |
| 9 | FAIL | — | 19 | Kimina | 4 |
| 10 | Kimina | 3 | 20 | Kimina | 9 |
Final score: Goedel-Prover and Kimina-Prover split the 19 proved cases. All 19 proofs verified by the Lean 4 compiler.
The single failure (, correct witness ) was a search problem: both models repeatedly tried and instead of across 80 total attempts. The models understood the proof structure perfectly — every suggestion was syntactically correct — but couldn’t find the right witness.
Pipeline Bugs Encountered
Three bugs were discovered and fixed during the proving run:
-
Sorry acceptance: Lean 4 compiles
sorryas a warning (exit code 0), not an error. The prover initially reported 23/23 “proved” because model outputs containingsorrywere accepted. -
Output parsing: Models wrap proofs in markdown headers and full theorem re-statements. Injecting the raw output into the source file produces garbage. Fixed with bracket-matching truncation.
-
decidevsnative_decide: Models generateby decidefor all proof obligations. The kernel evaluator times out on CF computation;native_decidecompiles to native code and runs instantly. Fixed with post-processing.
Exhaustive Verification: 0 Failures to
Verified: The v6 multi-pass GPU matrix enumeration kernel confirmed zero gaps for all (210 billion) in 116 minutes on 8× NVIDIA B200. This is a complete computational proof that Zaremba’s Conjecture holds for every integer up to 210 billion.
The kernel performs the entire CF tree walk on GPU via batched 2×2 matrix multiplication with fused expand+mark+compact. Phase A builds the tree to depth 12 on one GPU, Phase B distributes 244M matrices across all 8 GPUs in 64 rounds, each expanding to depth 62.
| Method | Hardware | Range | Time | Rate |
|---|---|---|---|---|
| Python (multiprocessing) | 112 CPU cores | to | 751.7 s | 1,330 d/s |
| v5 kernel | 1× B200 | to | 7.5 s | 13.3M d/s |
| v6 multi-pass | 8× B200 | to | 21.8 s | 45.9M d/s |
| v6 multi-pass | 8× B200 | to | 179 s | 55.9M d/s |
| v6 multi-pass | 8× B200 | to | 1,746 s | 57.3M d/s |
| v6 multi-pass | 8× B200 | to | 6,962 s | 30.2M d/s |
Speedup from Python baseline: ~43,000× on 8 GPUs.
The v5 kernel (single GPU) reformulated CF tree enumeration as batched 2×2 matrix multiplication — a 175× speedup over v4. The v6 kernel extended this with multi-pass chunking to eliminate buffer overflow at scale, enabling verification beyond .
Transfer Operator: Hausdorff Dimension to 15 Digits
| Quantity | Value |
|---|---|
| Hausdorff dimension | |
| Precision | 15 digits |
| ? | Yes (circle method threshold met) |
| Spectral gap | |
The spectral gap of is strong: the dominant eigenfunction controls the operator’s behavior overwhelmingly, with the second eigenvalue less than 30% of the leading one. This matches Jenkinson-Pollicott (2001) and subsequent refinements, independently verified from scratch on GPU.
Why this matters:
- confirms the Hausdorff dimension of is large enough for the circle method to potentially close the gap from density-1 to all
- The spectral gap quantifies mixing rates in the continued fraction dynamics
- Phase 2 complete: congruence spectral gaps computed for all 1,214 square-free moduli up to — every gap positive (min ), confirming property () at this scale. See findings
- Transitivity proved: algebraic proof that generates for every prime — no local obstructions exist. See findings
Analysis: The Witness Distribution
Define as the smallest Zaremba witness for with bound . Based on exhaustive computation over to :
Concentration at
For :
This is an extraordinarily tight concentration — 99% of witnesses fall in a band of relative width 2%.
Connection to the Golden Ratio
The continued fraction prefix of is overwhelmingly (99.7% of cases). The infinite continued fraction converges to
where is the golden ratio. The finite truncation and coprimality constraint shift the observed center to , between the convergents:
The Bound Is Tight
The maximum partial quotient actually used in the smallest witness:
| Max quotient | Frequency |
|---|---|
| 99.91% | |
| 0.07% | |
| 0.02% |
For 99.91% of all , the bound is necessary — would fail.
CF Length Distribution
The CF length of peaks at and grows as :
| Length | 9–10 | 11–12 | 13–14 | 15–16 | ||
|---|---|---|---|---|---|---|
| Frequency | 1.6% | 8.7% | 36.0% | 42.4% | 10.1% | 1.2% |
Implications
-
Search optimization. Any Zaremba verification algorithm should start searching at . This reduces the search space by compared to starting at . The v4 inverse CF kernel eliminates search entirely for most cases.
-
Transfer operator confirms circle method. The Hausdorff dimension gives , confirming the circle method threshold is met with substantial margin. The spectral gap of provides room for the congruence analysis in Phase 2.
-
Proof strategy. The transfer operator’s dominant eigenfunction peaks near , explaining why witnesses concentrate at . A full proof may require bounding the congruence transfer operator’s spectral radius uniformly across all moduli. See the companion transfer operator analysis for details.
-
LLM proving bottleneck. Current SOTA provers nail proof structure but fail at witness search. Adding MCTS or systematic enumeration on top of LLM tactic generation is the clear next step.
-
Gauss map connection. Witnesses concentrate near the preimage of under the Gauss map branch . The transfer operator spectral analysis makes this connection rigorous.
Reproducibility
Clone and verify:
git clone https://github.com/cahlen/idontknow
cd idontknow
# Compile v6 multi-pass kernel
nvcc -O3 -arch=sm_100a -o matrix_v6 \
scripts/experiments/zaremba-conjecture-verification/matrix_enum_multipass.cu -lpthread
# Verify d=1 to 1B (any multi-GPU NVIDIA system)
./matrix_v6 1000000000
# Verify d=1 to 210B (requires 8× B200 or similar, ~116 min)
./matrix_v6 210000000000
Single-GPU quick check (v5 kernel):
nvcc -O3 -arch=sm_100a -o matrix_enum \
scripts/experiments/zaremba-conjecture-verification/matrix_enum.cu
./matrix_enum 100000000 # 100M in ~7.5s on one B200
Raw Data
- v6 verification log (210B):
run_210B.log - v6 verification log (100B):
run_100B_v2.log - v6 verification log (10B):
run_10B_v3.log - Spectral gap data (1,214 moduli):
/data/spectral-gaps.json
References
- Zaremba, S.K. (1972). “La methode des ‘bons treillis’ pour le calcul des integrales multiples.” Applications of Number Theory to Numerical Analysis, pp. 39—119.
- Bourgain, J. and Kontorovich, A. (2014). “On Zaremba’s conjecture.” Annals of Mathematics, 180(1), pp. 137—196.
- Huang, S. (2015). “An improvement to Zaremba’s conjecture.” Geometric and Functional Analysis, 25(3), pp. 860—914.
- Dickson, L.E. (1901). Linear Groups with an Exposition of the Galois Field Theory. B.G. Teubner, Leipzig.
- Jenkinson, O. and Pollicott, M. (2001). “Computing the dimension of dynamically defined sets.” Ergodic Theory and Dynamical Systems, 21(5), pp. 1429—1445.
Computed 2026-03-28 on NVIDIA DGX B200. Transfer operator analysis: companion post. Code: github.com/cahlen/idontknow.
This work was produced through human–AI collaboration (Cahlen Humphreys + Claude). Not independently peer-reviewed. All code and data open for verification at github.com/cahlen/idontknow.