Walkthrough — Landau 4, certified prefix and Iwaniec P2s
- Problem:
problems/landau-n2-plus-1 - Date: 2026-08-17; extended 2026-09-04 and 2026-09-26
- Argument status: independently replayable finite computation
- Problem status: open; infinitude of primes is not claimed
0. What was actually missing
Infinitude is the headline and is out of reach. What was missing on disk was a prefix one can replay without trusting OEIS, together with the nearby object Iwaniec actually proved — with at most two prime factors, counted with multiplicity — and a comparison of the prime count to the Landau–Shanks / Bateman–Horn main term.
A new prime not on the published list we cite would have been a construction. That list is complete through . We did not beat it. The missing finite object was a replayable census past that hits the next Wolf rows, together with the list on the same range. The extension hits .
1. False starts
Hilbert 16 / Smale 13 and Smale 7 were the other computational reads. Both
need a heavier pipeline than a primality sieve. Landau 3 is already checked
through . See notes/ideation-historical.md.
The first sieve on this folder had three specific defects.
- It skipped , so the prime 2 was missing until the verifier complained. That is the point of a verifier.
sqrt_minus_oneused for . That formula is for primes . Every fell through to a linear search. Harmless at the cap, unusable for a complete factor sieve.trial_omegacounted distinct prime factors . Iwaniec's is . The stored count 34507 at was never written as a list, and it was the wrong predicate.
2. The useful failure
The mistake has a one-line witness:
So 18 is not an Iwaniec . Replaying the first sieve's predicate at reproduced the 34507 exactly; the count on the same range is 31953. The 2554-term gap is the class. A failed or mislabelled search with a verifier is the product. The 34507 was not a bound and is not one now.
The leftover analysis is what the dead end taught. Trial division of every up to is and dies at . The right remainder is not “try harder trial division”. It is that after every prime with has been divided out, a leftover larger than 1 has all prime factors , and cannot be a product of three such primes.
3. The click
Only even , and , can make prime. For each prime there is a square root of , and divides exactly on the two progressions . Sieving those progressions, and dividing out full powers, classifies for every even . Leftover composites are split by Pollard rho only to write the two prime factors down.
That is a finite classification, not a proof that the column is unbounded.
4. The argument, in the order it was found
Local constraints
Odd make even and greater than 2. A prime divisor of is 2 or . The equation is the Pell equation and has no solution for . Therefore an Iwaniec is either prime or a product of two distinct primes.
Complete classification by a residue sieve
Write for a square root of modulo . After removing every such from , the leftover satisfies:
- : fully factored by small primes;
- prime: one more prime factor, possibly itself;
- composite: both prime factors exceed , so and .
Miller–Rabin on , with a deterministic 64-bit witness set, separates the last two cases. Pollard rho is used only when is composite, to name the two factors.
What is compared, and what is not claimed
Hardy–Littlewood / Bateman–Horn / Landau–Shanks predict
with (OEIS A199401; Wolf's ). A match is a check of the implementation against a conjecture, not a proof of the conjecture and not a proof of infinitude.
Iwaniec's theorem supplies the comparison shape for the count. The ratio of our count to that shape is a descriptive diagnostic. It is not a new lower bound.
The published record we did not beat
Wolf, arXiv:0803.1456, tabulated through . OEIS A083844 continues that column through . Grantham–Graves, arXiv:2502.03513, computed every prime . A construction tonight would have been a prime with beyond that range. The census matches Wolf through instead.
5. Computer search
Replay the prefix from the problem folder:
python3 compute/sieve_n2p1.py --self-test
python3 compute/sieve_n2p1.py --n-max 1000000
python3 compute/verify.py
python3 compute/plot_counts.py
Replay the extension from compute/q2/:
compute/q2/run_all.sh
Replay the extension from compute/q3/ (regenerates the
gitignored lists):
compute/q3/run_all.sh
The sieve writes compute/prime_n.txt (54110 values of ) and
compute/p2_omega2.txt (147612 rows n p q with ).
compute/n2p1.json holds the counts, the Wolf rows, the Bateman–Horn
integral, and SHA-256 of the two lists. The verifier ignores the stored
prime list, re-tests every even and by Miller–Rabin, multiplies
every claimed factorization back, and factors every even
by an independent trial-plus-Pollard pass.
At :
| object | count |
|---|---|
| with prime | 54110 |
| 147612 | |
| Iwaniec (union) | 201722 |
| composites (wrong predicate) | 158367 |
At , from compute/q2/ (C residue sieve, 15 s, 56 MB RSS;
independent C trial-plus-Pollard verifier, 53 s; verify.py, 885 s):
| object | count |
|---|---|
| with prime | 456362 |
| 1334083 | |
| Iwaniec (union) | 1790445 |
| composites (wrong predicate) | 1421501 |
The histogram on the 5000001 live at is a partition: , , , , , , , , , , , . The prefix of both lists is the committed pair.
At , from compute/q3/ (segmented C residue sieve, 147 s, 93 MB
RSS; independent C trial-plus-Pollard verifier, 742 s; streaming Python
multiply-back plus Wolf/OEIS):
| object | count |
|---|---|
| with prime | 3954181 |
| 12172983 | |
| Iwaniec (union) | 16127164 |
| composites (wrong predicate) | 12914417 |
The histogram on the 50000001 live at is a partition:
, , , , ,
, , , , , ,
, . The prefix of both lists is the certified
q2 pair. The lists themselves are regenerable and gitignored; counts and
SHA-256 live in compute/q3/n2p1.json.
The histogram on the 500001 live is a partition: , , , , , , , , , .
Wolf / A083844, recomputed from our list as :
| ours | Wolf | |
|---|---|---|
| 112 | 112 | |
| 316 | 316 | |
| 841 | 841 | |
| 2378 | 2378 | |
| 6656 | 6656 | |
| 18822 | 18822 | |
| 54110 | 54110 | |
| 156081 | 156081 | |
| 456362 | 456362 | |
| 1339875 | 1339875 | |
| 3954181 | 3954181 |
The first 10000 terms of prime_n.txt are the OEIS A005574 b-file; the
10000th is 158704. First primes
match A002496. First Iwaniec
composites: , . The integer 18 is
absent from p2_omega2.txt.
Bateman–Horn at selected , from compute/comparison.json:
| primes | ratio | ||
|---|---|---|---|
| 112 | 121.09 | 0.9249 | |
| 841 | 854.54 | 0.9842 | |
| 6656 | 6609.15 | 1.0071 | |
| 12391 | 12379.26 | 1.0009 | |
| 28563 | 28558.07 | 1.0002 | |
| 54110 | 53969.85 | 1.0026 | |
| 102205 | 102312.04 | 0.9990 | |
| 239185 | 239309.07 | 0.9995 | |
| 456362 | 456409.53 | 0.9999 | |
| 872121 | 872370.61 | 0.9997 | |
| 2059567 | 2060327.13 | 0.9996 | |
| 3954181 | 3955300.85 | 0.9997 |
The Wolf-li form at is 53970.55. OEIS A331942 predicts 53970. A truncated Euler product for through recovers 1.37281051 against the published 1.37281346.

SHA-256 of the committed lists (also in compute/n2p1.json):
prime_n.txt:89b7f94046012758cbc48f0b1b4511efb2e864cae0a46b29ea7210317aa3bc32p2_omega2.txt:9f3183d98bc58f09d5e48bf567f46fd6b39eb7cd710d4e81ca428aaf3cb49115
SHA-256 of the lists in compute/q2/ (also in compute/q2/n2p1.json):
prime_n.txt:31207a4a146e862e3a55882a8395b94567d8cc49292a935df7624ac915011409p2_omega2.txt:aa7f83c18bbe68419888212bb6e1fe7b5787949e6084a553bdc9d03bbcd56f5a
SHA-256 of the lists regenerated in compute/q3/ (also in compute/q3/n2p1.json):
prime_n.txt:ab3ea9a1215a6fd95dec7c1065712d1f2786870ebdc94bc587ff06a4dfee158bp2_omega2.txt:74184d390df2ac94bac46d504bc63911c125ef6014b8593171f512c27e61dc3a
The six-prime Miller–Rabin set without 17 only covers (OEIS A014233). That is enough for and not enough for . The working bases are now , which cover .
6. Proven vs still open
Proven here, as a finite computation: there are exactly 54110 integers
with and prime, and exactly 147612
further in that range with . Extending the same
classification, there are exactly 456362 such primes with
and exactly 1334083 further in that range with ,
and exactly 3954181 such primes with and exactly 12172983
further in that range with . The counts
sit in compute/q3/n2p1.json and are re-derived by the C
trial-plus-Pollard verifier. The prime count equals Wolf's
. The count tracks the Bateman–Horn main term to
a few parts in . None of that is a lower bound on the number of
such primes for all , and none of it is infinitude.
Still open: Landau 4.
Not claimed: a new prime off the Wolf / Grantham lists; an improvement of Iwaniec's exponent; anything about 2026 preprints. The Goldbach other-other check on this prefix (every in the list is with both still in the list; largest at ) is a consistency check, not a bound: Grantham–Graves already ran it to .