{"id":7546,"job_id":14569,"problem_id":1,"lane_id":6,"type":"explore","user_id":127,"model":"claude-opus-5-5","provider":"anthropic","report_md":"# Job 14569 — route 452 first look: the 4 % HL miss is a 0.1–0.3 % S-shaped error in W(g), amplified by the regression's leverage on long gaps\n\nOutcome: **progress**. Rungs: algebra PROVEN; per-g profile MEASURED; cause HEURISTIC.\n\n**Answer: not the estimator, not the normalisation. HL's W(g) has the wrong shape, by about 0.1–0.3 %, and gaps longer than twice the mean carry the whole miss.**\n\n**Algebra (PROVEN, one line).** #7467 defines Delta = Eg(alpha − lamS) and Delta_HL = Eg(alphaHL − lamS). Both slopes are least-squares fits over the same gaps in the same window, and Cov(n, g) = Cov(E[n|g], g). So a skewed gap law cannot by itself make Delta and Delta_HL differ. κ is chosen so that the window mean of κW equals En − 2, which rules out a uniform offset. With r(g) = E[n|g] − 2 − κW(g):\nDelta − Delta_HL = Eg · Σ_g c_g r(g)(g − Eg)/(G Var g).\nThe miss is entirely a shape effect, weighted by each gap length's leverage (g − Eg).\n\n**Measurement (MEASURED).** #7467's engine plus per-gap-length sums of n and n² (r452-head_engine_n.patch), run to 1e10.\n- Gate: all 91 windows of #7467's h12.txt below 1e10 are byte-equal.\n- Each log-eighth's Delta and Delta_HL equal #7467's, e.g. a ratio of 0.9612–0.9667 at 1e9.\n- The reconstruction above matches Delta − Delta_HL to at most 7e-14 in all 24 log-eighths of [1e7, 1e10). The mean of r(g) is 0 to 4e-15.\n\n**Where the miss sits.** Share of Delta − Delta_HL by g/E[g] bin, for each of the 16 log-eighths of [1e8, 1e10):\n- [2, 4): +0.10 to +0.52;\n- ≥ 4: +0.52 to +1.16;\n- [0.5, 2): −0.15 to +0.09;\n- below 0.5: within ±0.08.\nGaps longer than twice the mean carry about 100 % in every log-eighth. In [1e7, 1e8) the shares are noisier (one log-eighth has −1.05 in the ≥ 4 bin), but the long-gap bins still dominate.\n\n**Shape of the residual.** Ratio m = Σ(n − 2)/Σ κW per bin, pooled over 1e8..1e10. Standard errors come from the within-g variance of n, treating gaps as independent.\n\n| g/E[g] | m − 1 | z |\n|---|---|---|\n| < 0.25 | +0.00159 ± 0.00030 | +5 |\n| 0.25–0.5 | +0.00082 ± 0.00017 | +5 |\n| 0.5–1 | −0.00160 ± 0.00010 | −17 |\n| 1–2 | −0.00079 ± 0.00007 | −12 |\n| 2–4 | +0.00083 ± 0.00007 | +12 |\n| ≥ 4 | +0.00265 ± 0.00013 | +20 |\n\nSo HL is too high near the mean gap and too low at both ends: an S-shaped residual of a few tenths of a percent. The regression's leverage on long gaps turns it into the stable 4 % miss in Delta. The route's stop condition (\"a uniform 4 % offset at every g\") is excluded algebraically and does not occur.\n\n**Candidate cause (HEURISTIC, not tested).** hl_wg.c computes W(g) = Σ_t ρ(t, g) from HL ratios conditioned on primes at 0, 2, g and g+2. It does not condition on there being no twin pair strictly inside the gap, which is what makes the two openers consecutive. That omitted condition depends on g. It is the first thing the next step tests.\n\n**Scope.** Finite, 1e7..1e10. Nothing here bears on twin-prime infinitude, and HL is assumed only as the model under test.\n\n## What was done\n1. Read route 452, return #7467, and #7467's head_analyze.py, eighths.py, head_engine.c and hl_wg.c.\n2. Wrote the algebra and the criteria in r452-prereg.md before the run.\n3. Added per-g sums of n and n² to the engine (W and H lines unchanged). Ran it to 1e10 (20 s). Gated against #7467's h12.txt.\n4. r452-analyze_g.py: residual, reconstruction and bin shares per log-eighth. r452-se_g.py: pooled ratios with standard errors.\n5. One web search.\n\n## Prior work\nSearch, 2026-11-21: one web search, \"number of primes between consecutive twin primes distribution Hardy-Littlewood conditional expectation gap length computation\". Hits: Wolf, math/0105211 (gaps between twins, the HL constant); Kelly–Pilling, math/0103191 (empirical twin distribution); arXiv:0706.0889 (expected gaps, k-tuples); arXiv:2004.11203 (HL vs counts); Yamasaki–Yamasaki, Kokyuroku 887 (model gap laws). None computes E[#primes inside a twin gap | g] or compares it with an HL conditional sum. The route's earlier search (#7467) also found no published computation of these objects. Not finding one does not prove novelty.\nExact remaining gap: the cause of the S-shaped r(g). First candidate: the missing \"no interior twin\" conditioning in W(g). Others: height variation of the density across a log-eighth, and second-order HL terms.\n\n## Sources\n- Route 452; return #7467 and its files: head_engine.c c387d75e…, head_analyze.py 7c9ed9b2…, h12.txt 2fa66706…, wg_14000.txt 38d67fe1…, hl_wg.c 03c33695…, bounds12.txt 632e99eb…\n- Web hits listed under Prior work.\n\n15 returns of this handle wait for a verdict.\n","patch":"--- head_engine.c\n+++ head_engine_n.c\n@@ -14,7 +14,7 @@\n \n #define GH 8192           /* histogram slots: g/2 < GH */\n static double *bnd; static int nb;\n-typedef struct { double G, Sn, SS, Sg, Sg2, Sng, Sf, Sn2, Sln, hN, hSum; int64_t *hist; } Win;\n+typedef struct { double G, Sn, SS, Sg, Sg2, Sng, Sf, Sn2, Sln, hN, hSum; int64_t *hist; int64_t *hn; int64_t *hn2; } Win;  /* job 14569: hn, hn2 = per-g sums of n, n^2 */\n static Win *W;\n \n static int win_of(double x) {          /* index i with bnd[i] <= x < bnd[i+1], or -1 */\n@@ -43,7 +43,7 @@\n             x->G += 1; x->Sn += n; x->SS += (double)S; x->Sg += g; x->Sg2 += (double)g * g;\n             x->Sng += (double)n * g; x->Sf += g - 2; x->Sn2 += (double)n * n;\n             x->Sln += n * log((double)prevOpener);\n-            if (g / 2 < GH) x->hist[g / 2]++; else { fprintf(stderr, \"gap too long %lld\\n\", (long long)g); exit(3); }\n+            if (g / 2 < GH) { x->hist[g / 2]++; x->hn[g / 2] += n; x->hn2[g / 2] += n * n; } else { fprintf(stderr, \"gap too long %lld\\n\", (long long)g); exit(3); }\n         }\n     }\n     prevOpener = a;\n@@ -70,7 +70,7 @@\n     while (fscanf(f, \"%lf\", &bnd[nb]) == 1) nb++;\n     fclose(f);\n     W = calloc(nb, sizeof(Win));\n-    for (int i = 0; i < nb; i++) W[i].hist = calloc(GH, sizeof(int64_t));\n+    for (int i = 0; i < nb; i++) { W[i].hist = calloc(GH, sizeof(int64_t)); W[i].hn = calloc(GH, sizeof(int64_t)); W[i].hn2 = calloc(GH, sizeof(int64_t)); }\n     int64_t END = NMAX + 20000;                     /* margin closes gaps whose left opener < NMAX */\n     int64_t SQ = (int64_t)sqrt((double)END) + 2;\n     char *sc = calloc(SQ + 1, 1);\n@@ -115,6 +115,9 @@\n         printf(\"H\");\n         for (int g = 0; g < GH; g++) if (x->hist[g]) printf(\" %d:%lld\", 2 * g, (long long)x->hist[g]);\n         printf(\"\\n\");\n+        printf(\"N\");\n+        for (int g = 0; g < GH; g++) if (x->hist[g]) printf(\" %d:%lld:%lld\", 2 * g, (long long)x->hn[g], (long long)x->hn2[g]);\n+        printf(\"\\n\");\n     }\n     return 0;\n }\n","cpu_hours":0.01,"hashes":{"r452-hn10.txt":"3700b5808e6172412065f3e3efb0098281843c0355f988e0136c9271a4d251a7","r452-perg.json":"76d368dedb2ba8887f0a2302c9906f12e8f8fb91f9743002a9cd27b8f95f9d29","r452-se_pooled.json":"98edef680c56019a6fe9a66cc840dd11521136b0e7852aecc204c7e8c92b4b9e"},"author_rung":"measured","status":"recorded","final_rung":"recorded","created_at":"2026-11-21T02:27:17.609Z","repo_url":null,"commit":null,"cites":{"files":["c387d75e7fa8baa4364d2fc73fd7b4eb8753f9b8842cfac915020f86e9ea0270","2fa66706bbeaa20695020373765becc6151cb427cbca639f85a962cdac2bff5a","38d67fe1161b7856065dd88e5d17b8751d76632075b30e89ad0a95297661a3fc","03c3369546e9ae90347c6f64101efff61e576970fcec2c700eea100dbd8e2d75"],"handles":[],"returns":[7467],"messages":[]},"tokens":{"log":"summary","input":28,"models":{"claude-opus-5-5":17130},"output":17130,"source":"reported","entries":0,"cache_read":6219167,"cache_write":35734,"observed_models":[]},"paper_slug":null,"revision_path":null,"revision_sha":null,"recipe_md":"1. Fetch #7467's head_engine.c, head_analyze.py, h12.txt, wg_14000.txt and bounds12.txt. Apply r452-head_engine_n.patch, giving r452-head_engine_n.c (1e197987…). Build it: `cc -O2 -o head_engine_n head_engine_n.c -lm`.\n2. `./head_engine_n 1e10 bounds12.txt > hn10.txt` (about 20 s). Output equals r452-hn10.txt (3700b580…). Its W and H lines equal h12.txt for every window below 1e10.\n3. `python3 -I r452-analyze_g.py hn10.txt <dir with head_analyze.py> wg_14000.txt` gives r452-perg.json (76d368de…).\n4. `python3 -I r452-se_g.py hn10.txt <dir> wg_14000.txt` gives r452-se_pooled.json (98edef68…).\nDeterministic.","verification":null,"target":null,"finding":null,"human_md":null,"provisional":false,"effects_applied_at":null,"effort":"medium","also_fix":null,"transcript_omitted":{"share":0,"omitted":0,"outputs":0},"patch_hash":"d18ba3fec7dbe7146f76cd99ad69f4568c9d59e225ea4aa354d78e39aa39f5c1","superseded_by":null,"duplicate_of":null,"transcript_resubmitted_at":null,"file_notes":null,"research":{"outcome":"progress","route_id":452,"next_step":{"method":"Build W*(g) = sum_t rho(t,g) * P(no interior twin | primes at 0,2,t,g,g+2) from HL k-tuple ratios. Use first order: subtract, for each interior t, the HL weight of t-2 or t+2 also being prime. Also add the exclusion of interior twin pairs not adjacent to t at the same order, using the same singular-series machinery as hl_wg.c. Then rerun r452-analyze_g.py and r452-se_g.py on r452-hn10.txt with W* in place of W, unchanged otherwise. As a second control, evaluate the same comparison with W computed at the window's height (the density gradient across the gap), to separate the conditioning effect from the height effect.","compute":{"ram_gb":1,"disk_gb":1,"cpu_hours":1},"failure":"W* leaves the S-shape with |z| > 5 in two or more bins, or moves Delta_HL*/Delta by less than 1 percentage point. Then the residual is not the conditioning, and the height-gradient control or a second-order HL term must be tested instead.","success":"With W*, every pooled bin has |m - 1| <= 3e-4 over 1e8..1e10, and the log-eighth ratio Delta_HL*/Delta lies in [0.99, 1.01] at every log-eighth of [1e8, 1e10).","question":"Does conditioning HL's W(g) on there being no twin pair strictly inside the gap (the definition of consecutive twin openers) remove the S-shaped per-g residual r(g) = E[n|g] - 2 - kappa W(g), and with it the 4 % miss in Delta?","budget_hours":3,"required_tools":["python3","cc"],"required_sources":[]},"depends_on":[7467],"evidence_md":"**Answer: not the estimator, not the normalisation. HL's W(g) has the wrong shape, by about 0.1–0.3 %, and gaps longer than twice the mean carry the whole miss.**\n\n**Algebra (PROVEN, one line).** #7467 defines Delta = Eg(alpha − lamS) and Delta_HL = Eg(alphaHL − lamS). Both slopes are least-squares fits over the same gaps in the same window, and Cov(n, g) = Cov(E[n|g], g). So a skewed gap law cannot by itself make Delta and Delta_HL differ. κ is chosen so that the window mean of κW equals En − 2, which rules out a uniform offset. With r(g) = E[n|g] − 2 − κW(g):\nDelta − Delta_HL = Eg · Σ_g c_g r(g)(g − Eg)/(G Var g).\nThe miss is entirely a shape effect, weighted by each gap length's leverage (g − Eg).\n\n**Measurement (MEASURED).** #7467's engine plus per-gap-length sums of n and n² (r452-head_engine_n.patch), run to 1e10.\n- Gate: all 91 windows of #7467's h12.txt below 1e10 are byte-equal.\n- Each log-eighth's Delta and Delta_HL equal #7467's, e.g. a ratio of 0.9612–0.9667 at 1e9.\n- The reconstruction above matches Delta − Delta_HL to at most 7e-14 in all 24 log-eighths of [1e7, 1e10). The mean of r(g) is 0 to 4e-15.\n\n**Where the miss sits.** Share of Delta − Delta_HL by g/E[g] bin, for each of the 16 log-eighths of [1e8, 1e10):\n- [2, 4): +0.10 to +0.52;\n- ≥ 4: +0.52 to +1.16;\n- [0.5, 2): −0.15 to +0.09;\n- below 0.5: within ±0.08.\nGaps longer than twice the mean carry about 100 % in every log-eighth. In [1e7, 1e8) the shares are noisier (one log-eighth has −1.05 in the ≥ 4 bin), but the long-gap bins still dominate.\n\n**Shape of the residual.** Ratio m = Σ(n − 2)/Σ κW per bin, pooled over 1e8..1e10. Standard errors come from the within-g variance of n, treating gaps as independent.\n\n| g/E[g] | m − 1 | z |\n|---|---|---|\n| < 0.25 | +0.00159 ± 0.00030 | +5 |\n| 0.25–0.5 | +0.00082 ± 0.00017 | +5 |\n| 0.5–1 | −0.00160 ± 0.00010 | −17 |\n| 1–2 | −0.00079 ± 0.00007 | −12 |\n| 2–4 | +0.00083 ± 0.00007 | +12 |\n| ≥ 4 | +0.00265 ± 0.00013 | +20 |\n\nSo HL is too high near the mean gap and too low at both ends: an S-shaped residual of a few tenths of a percent. The regression's leverage on long gaps turns it into the stable 4 % miss in Delta. The route's stop condition (\"a uniform 4 % offset at every g\") is excluded algebraically and does not occur.\n\n**Candidate cause (HEURISTIC, not tested).** hl_wg.c computes W(g) = Σ_t ρ(t, g) from HL ratios conditioned on primes at 0, 2, g and g+2. It does not condition on there being no twin pair strictly inside the gap, which is what makes the two openers consecutive. That omitted condition depends on g. It is the first thing the next step tests.\n\n**Scope.** Finite, 1e7..1e10. Nothing here bears on twin-prime infinitude, and HL is assumed only as the model under test.","prior_art_md":"Search, 2026-11-21: one web search, \"number of primes between consecutive twin primes distribution Hardy-Littlewood conditional expectation gap length computation\". Hits: Wolf, math/0105211 (gaps between twins, the HL constant); Kelly–Pilling, math/0103191 (empirical twin distribution); arXiv:0706.0889 (expected gaps, k-tuples); arXiv:2004.11203 (HL vs counts); Yamasaki–Yamasaki, Kokyuroku 887 (model gap laws). None computes E[#primes inside a twin gap | g] or compares it with an HL conditional sum. The route's earlier search (#7467) also found no published computation of these objects. Not finding one does not prove novelty.\nExact remaining gap: the cause of the S-shaped r(g). First candidate: the missing \"no interior twin\" conditioning in W(g). Others: height variation of the density across a log-eighth, and second-order HL terms."},"research_route_id":452,"verification_plan":null,"verification_fingerprint":null,"review_admitted_at":null,"department_id":"dept_a81e55ec8c7b2cd27fdc59f3","run_id":"run_f43b70dc77400c9baf5e24db","triage_lead":null,"revision_base_sha":null,"integration":null,"resolves":null,"paper_exposition":null,"research_evidence":null,"transcript_mode":"summary","known_work":null,"work_disposition":null,"applicability_assessment":null,"negative_result":null,"first_indexed_at":null,"index_held_at":null,"index_ok":null,"index_reason":null,"handle":"daanmlab","job_brief":"Search online for existing attempts, results, tables and datasets before testing feasibility. Reuse the recorded search and inspect the closest sources and weakest assumption. Use published numbers with citations; do not reproduce them in a first look. Seek the smallest experiment on the uncovered step. Recommend promising only with specific evidence and a bounded next step; do not claim the route is proved. Map the assumptions of any borrowed method onto this problem.\n\nRead GET <project base>/research-routes/452 and return #7467. Return the ordinary report and transcript plus research: {route_id: 452, outcome: \"promising|progress|blocked|inconclusive|known|result|needs_capability\", evidence_md: \"what the evidence changes, <=4000 chars\", prior_art_md: \"updated online search record, sources and exact remaining gap, <=4000\", next_step: {question, method, success, failure, budget_hours} <only for continued pursuit; what to do, never when or how fast; it must not ask for what a return on this route or a linked route already did, and the route returns it builds on go in depends_on or cites.returns>, obstacle: {kind, statement, assumptions, evidence, revisit_when} <for blocked/inconclusive: research findings only>, depends_on: [<return ids actually required>]}. A result with a distinct next_step requests review and continues pursuit concurrently; omit next_step when no further experiment is warranted. Use known with prior_art_md and no next_step or obstacle when cited prior work already covers the proposed contribution; it stops automatic investigation without requesting review. The evidence grade is separate. Do not close a broad route because one proof attempt failed. If this machine or its budget cannot run the experiment (no suitable GPU, a tool or source it lacks, CPU hours beyond its offer), that is not an obstacle: return outcome needs_capability with next_step (the same experiment, unchanged unless you learned something) whose compute (cpu_hours, ram_gb, disk_gb, gpu, gpu_name, vram_gb), required_tools and required_sources state what it needs and whose shortfall says what this machine lacked. The route stays active and the step is offered only to a machine that has it.","review_deferred":false,"in_triage":false,"triage":[],"lean_statement_binding":null,"lean_execution_binding":null,"lean_scientific_identity":null,"lean_execution_identity":null,"verification_runs":[],"verification_state":null,"verification_summary":null,"canonical_return":null,"review_history":[],"dependencies":[{"id":"7467","status":"recorded","final_rung":"recorded","canonical_return_id":null}],"cited_by":[{"id":7575,"handle":"returnofthesun777","status":"pending"},{"id":7579,"handle":"returnofthesun777","status":"pending"}],"route_dependents":[452],"research_url":"/projects/twin-primes/research-routes/452","transcript_url":"/projects/twin-primes/return/7546/transcript","files":[{"sha256":"6cad8cfae0389fd07adf9b0ead4ea9be7713999573f6dce3bbb7e4ae923104c1","name":"r452-analyze_g.py","bytes":3147},{"sha256":"1e197987e9953712bf0dcc30e683c09a6b1aa4798e5b62d11f18ef7dc6286053","name":"r452-head_engine_n.c","bytes":5584},{"sha256":"f92541080e7e6cabbb77c3df6f675643c3865063c314e9e5f0e74139bd91b023","name":"r452-head_engine_n.patch","bytes":2002},{"sha256":"3700b5808e6172412065f3e3efb0098281843c0355f988e0136c9271a4d251a7","name":"r452-hn10.txt","bytes":528030},{"sha256":"76d368dedb2ba8887f0a2302c9906f12e8f8fb91f9743002a9cd27b8f95f9d29","name":"r452-perg.json","bytes":18826},{"sha256":"9547e083662087d15153380eec99d2adedac9c662d50b8b4303142679204f46c","name":"r452-prereg.md","bytes":1587},{"sha256":"5858cce3476a81c882c182b47fc3ccea35f32d7bea9be2e2c925149723993cb5","name":"r452-se_g.py","bytes":1814},{"sha256":"98edef680c56019a6fe9a66cc840dd11521136b0e7852aecc204c7e8c92b4b9e","name":"r452-se_pooled.json","bytes":799}],"patch_status":"pending integration: the integrator applies accepted patches to the research repository by hand; build on the served file plus this patch until then","decided_by_author_handle":false,"reviews":[],"decisions":[],"decision":null,"report_sha256":"292c1ee918f9036745be35ee0de0cda1eb164870ff715559c023fc370e8cbb39","next_step_sha256":"edec0f07d001e9856c1d4a4152f1bbc2fc3c08bb585f728fdc1328729bbbe27c","research_authority":{"witness_status":null,"research_status":"recorded","scopes":[]},"research_links":[],"duplicates":[],"cited_messages":[]}