problems / landau-n2-plus-1

Also in this folder: compute/ · figures/

Attack log

2026-08-17 — pick

See notes/picks/2026-08-17-ideation-historical.md. Landau 4 chosen over the rest of Hilbert/Smale/Landau because it is still open and has a checkable finite list plus Iwaniec's P2 theorem as a nearby object.

2026-08-17 — first compute

Enumerate even n (odd n>1 makes n^2+1 even and >2). Trial-split n^2+1; record primes and P2s. Write compute/ tables and a verifier that ignores the tables and re-derives them.

2026-08-17 — certified prefix

compute/sieve_n2p1.py then compute/verify.py: n_max=200000, exactly 12391 primes n^2+1 (including 2=1^2+1). Verifier OK (extra=0 missing=0). First 8 values 2,5,17,37,101,197,257,401 match OEIS A002496. Not a proof of infinitude.

2026-08-17 — published record (do not claim a new prime)

Fetched the lists we will cite, before extending the sieve.

A new prime not on those lists would require n≳2.5×1014n\gtrsim 2.5\times10^{14}. We will not beat that tonight. The dent is a replayable certified prefix, a complete Iwaniec-P2 table on the same range, and a Bateman–Horn / Wolf comparison. Search residue is not a lower bound.

2026-08-17 — bugs in the first sieve

  1. sqrt_minus_one used a(q+1)/4a^{(q+1)/4} with a=−1a=-1. That formula is for residues modulo a prime ≡3(mod4)\equiv 3\pmod 4; every q≡1(mod4)q\equiv 1\pmod 4 fell through to a linear search. Fine at the 200000 cap, fatal if we sieve with large qq.
  2. trial_omega counted distinct prime factors ω\omega, not Ω\Omega. Iwaniec's P2P_2 is Ω≤2\Omega\le 2. Counterexample: 182+1=325=52⋅1318^2+1=325=5^2\cdot 13 has ω=2\omega=2 and Ω=3\Omega=3, so it is not an Iwaniec P2P_2. The stored count 34507 is an ω≤2\omega\le 2 count, and the P2P_2 list was never written to disk.
  3. The first sieve skipped n=1n=1 until the verifier caught it. Keep that discipline.

Next: residue factor-sieve with a correct −1 mod q\sqrt{-1}\bmod q, classify by Ω\Omega, store factorizations, compare to Wolf / A083844 / A005574 and to Cq∫dt/log⁡(t2+1)C_q\int dt/\log(t^2+1).

2026-08-17 — residue sieve, Ω, Wolf match

Rewrote compute/sieve_n2p1.py against compute/n2p1_lib.py. −1 mod q\sqrt{-1}\bmod q is now a(q−1)/4a^{(q-1)/4} for the first quadratic nonresidue aa (so a=2a=2 when q≡5(mod8)q\equiv 5\pmod 8). The sieve divides n2+1n^2+1 by every prime q≡1(mod4)q\equiv 1\pmod 4, q≤Nq\le N, on the two progressions n≡±r(modq)n\equiv\pm r\pmod q. Leftover factors are all >N>N, hence 1, a prime, or a product of two primes.

Self-test and N=2000N=2000 first. Then N=200000N=200000: 12391 primes (same as the first prefix), ω≤2\omega\le 2 composites = 34507 (exactly the first sieve's "P2" count), true Ω=2\Omega=2 composites = 31953. Difference 2554 is the 182+1=32518^2+1=325 class. Bateman–Horn at N=200000N=200000 is 12379.26; ratio 1.000951.00095.

Then N=106N=10^6, 37 seconds. Counts:

Wolf / A083844 πq(10k)\pi_q(10^k) matches for every reachable k=6,…,12k=6,\ldots,12. In particular πq(1012)=54110\pi_q(10^{12})=54110. OEIS A005574 prefix: the 10000th nn is 158704, present. First P2s: 82+1=5⋅138^2+1=5\cdot 13, 122+1=5⋅2912^2+1=5\cdot 29; 1818 is absent.

Bateman–Horn at N=106N=10^6: Cq∫=53969.85C_q\int=53969.85, count/BH =1.00260=1.00260. Wolf-li form 53970.55. OEIS A331942 predicts 53970. Truncated Euler product for CqC_q through 2⋅1062\cdot 10^6 is 1.37281051 against the published 1.37281346.

Did not beat Wolf or Grantham. No new prime. The new object is the complete Ω=2\Omega=2 list with factors, compute/p2_omega2.txt.

Replay: python3 compute/sieve_n2p1.py --n-max 1000000 then python3 compute/verify.py then python3 compute/plot_counts.py.

2026-08-17 — verifier OK

compute/verify.py on the N=106N=10^6 lists, 203 seconds:

The first complete-scan attempt used a 50000 trial bound and was killed after seven silent minutes. Completeness is Pollard after a 2003 trial bound, not a residue sieve.

2026-08-17 — stop

No new prime. Infinitude not claimed. The replayable objects are the two lists, the Wolf match, and the Bateman–Horn table in compute/comparison.json / figures/counts_vs_bh.png.

2026-09-04 — literature before extending

Re-opened Wolf arXiv:0803.1456v3 HTML. Table I: πq(1013)=156081\pi_q(10^{13})=156081, πq(1014)=456362\pi_q(10^{14})=456362. OEIS A083844 matches. Grantham–Graves arXiv:2502.03513: complete list through 6.25×10286.25\times 10^{28}. A new prime still needs n≳2.5×1014n\gtrsim 2.5\times 10^{14}; not attempted.

Miller–Rabin: the committed witness set (2,3,5,7,11,13,23)(2,3,5,7,11,13,23) is missing 17. OEIS A014233 / Wikipedia: bases 2,3,5,7,11,132,3,5,7,11,13 only cover n<3.474×1012n<3.474\times 10^{12}. At N=106N=10^6, n2+1≤1012+1n^2+1\le 10^{12}+1 was inside that bound. At N=107N=10^7, n2+1≤1014+1n^2+1\le 10^{14}+1 is not. Added 17,19,2317,19,23 (A014233 a(9)=3.825×1018a(9)=3.825\times 10^{18}).

2026-09-04 — C residue sieve at N=107N=10^7

compute/q2/sieve_n2p1.c is the same residue algorithm as sieve_n2p1.py. Cross-check at N=2000N=2000 (lists identical) and at N=106N=10^6 (identical to the committed 54110 primes and 147612 Ω=2\Omega=2 rows, including the Ω\Omega histogram). RSS 7 MB at N=106N=10^6, 1.2 s.

Then N=107N=10^7, 15 s, RSS 56 MB:

Wolf / A083844 match for k=6,…,14k=6,\ldots,14, including the two new rows πq(1013)=156081\pi_q(10^{13})=156081 and πq(1014)=456362\pi_q(10^{14})=456362. Prefix of both lists equals the committed N=106N=10^6 files. Bateman–Horn at N=107N=10^7: Cq∫=456409.53C_q\int=456409.53, count/BH =0.99990=0.99990.

2026-09-04 — independent C verifier

compute/q2/verify_n2p1.c: Miller–Rabin every even nn, multiply-back every P2 row, trial primes ≤2003\le 2003 plus Pollard of every even n2+1n^2+1. Different algorithm from the residue sieve. 53 s:

2026-09-04 — Python verify.py OK

compute/verify.py --dir compute/q2, 885 s after fixing a quadratic set(found) in the extra/missing check (that construction hung the first N=10^7 attempt). Independent of the residue sieve:

Dent: independently certified extension past N=106N=10^6 matching Wolf πq(1013)=156081\pi_q(10^{13})=156081 and πq(1014)=456362\pi_q(10^{14})=456362, plus a complete Ω=2\Omega=2 list on the same range. Did not produce a prime off Wolf/Grantham. Infinitude not claimed.

2026-09-04 — stop

The replayable objects are compute/q2/prime_n.txt, compute/q2/p2_omega2.txt, the Wolf match through 101410^{14}, and compute/q2/comparison.json. RSS 56 MB. No new prime.

2026-09-26 — literature before N=108N=10^8

Re-opened Wolf arXiv:0803.1456v3 HTML Table I: πq(1016)=3954181\pi_q(10^{16})=3954181. OEIS A083844 a(16)=3954181a(16)=3954181. Grantham–Graves arXiv:2502.03513 Table 1 repeats that row and continues to 6.25×10286.25\times 10^{28}. Miller–Rabin bases 2,3,5,7,11,13,17,19,232,3,5,7,11,13,17,19,23 still cover n2+1≤1016+1n^2+1\le 10^{16}+1 (A014233 a(9)=3.825×1018a(9)=3.825\times 10^{18}). 1016+110^{16}+1 is composite, so #{n≤108:n2+1 prime}\#\{n\le 10^8:n^2+1\text{ prime}\} is the same integer as πq(1016)\pi_q(10^{16}).

2026-09-26 — segmented C sieve at N=108N=10^8

compute/q3/sieve_n2p1.c is the q2 residue algorithm in strips of five million even nn (about 50 MB leftover plus precomputed −1 mod q\sqrt{-1}\bmod q). Identity against the committed N=106N=10^6 lists in one strip and in five strips of 10510^5 even nn. Smoke at N=2000N=2000: 209 primes, 432 Ω=2\Omega=2 rows.

Then N=108N=10^8, 147 s, RSS 93 MB. First strip n≤107n\le 10^7 reproduced the certified q2 counts (456362 primes, 1334083 Ω=2\Omega=2). Full range:

Wolf / A083844 match for k=6,…,16k=6,\ldots,16, including the new row πq(1016)=3954181\pi_q(10^{16})=3954181. Prefix of both lists equals the certified N=107N=10^7 files. Bateman–Horn at N=108N=10^8: Cq∫=3955300.85C_q\int=3955300.85, count/BH =0.99972=0.99972. Last prime n=99999966n=99999966, n2+1=9999993200001157n^2+1=9999993200001157, matches OEIS A083846 a(16)a(16).

2026-09-26 — independent C verifier

compute/q3/verify_n2p1.c: Miller–Rabin every even nn, multiply-back every P2 row, trial primes ≤2003\le 2003 plus Pollard of every even n2+1n^2+1. Different algorithm from the residue sieve. Bitsets for membership (12.5 MB). 742 s:

Streaming Python verify_py.py (different language): every claimed prime retested, every P2 row multiplied back, OEIS A005574 prefix, Wolf rows through 101610^{16}. Completeness of the P2P_2 census is the C trial-plus-Pollard pass.

Dent: independently certified extension past N=107N=10^7 matching Wolf πq(1016)=3954181\pi_q(10^{16})=3954181, plus a complete Ω=2\Omega=2 list on the same range. Did not produce a prime off Wolf/Grantham. Infinitude not claimed.

2026-09-26 — stop

The replayable objects are compute/q3/n2p1.json, the Wolf match through 101610^{16}, and compute/q3/run_all.sh (regenerates the gitignored lists). RSS 93 MB. No new prime.