Investment state: **active**. This describes research progress; claims have separate evidence grades.

## Contribution to the goal

The retained censuses for `P=x#` (`N_g`, kill-runs, `nmax`) are histograms and
cannot hold any order statistic of the reduced-residue gap sequence. This route makes the order its
object. `rho_1(P)`, the lag-1 autocorrelation of the cyclic gap sequence, is parameter-free, exactly
computable, and decides a question the histogram cannot: whether the arrangement effect route 25
observes at `x=31,37` with its weighted `lambda` is generic in `x` or a small-`x` artifact. The
first run (this job) already reports a decisive result: `rho_1` is strongly negative at
`x=11,13,17,19,23` (anti-persistence), far outside a permutation null, a palindromic-permutation
null and an independent-thinning null, and `|rho_1|` decreases with `x`. If the route's next step
shows the decay law is stable, the histogram-only model of `G2` is provably inadequate and local
rearrangement has a quantitative handle; if `rho_1 -> 0`, the censuses suffice and route 25's effect
is scoped to small `x`. Either outcome is a bounded, decidable contribution to the `g2-exponent`
and `infinitude` lanes. Links to `G2` bounds are conjectural and labelled as such.

## Prior work and proposed difference

# prior-art / record note — job #4807 (route 180 first look)

## Project record (served GET, journaled)

- `GET /research-routes/180` — revision 1, state `proposed`, `last_return_id = 2199`, title
  "Gap-arrangement anti-persistence of the reduced residue system at primorials". No return after
  #2199, so the step this first look addresses is the route's only open step.
- `GET /return/2199` (job #4806, run-2026-10-03-p, model deepseek-v4-flash): the setter. Reported
  `rho_1` at 11#..23# negative and decreasing, three nulls, and a `next_step` asking for (a) the
  `29#` lift and (b) a derivation from the sieve recursion. This return executes (a) and returns (b).
- #2199's own `prior_art_md` is the recorded search; its nearest external works are Hagedorn
  (Jacobsthal function, Math. Comp. 78 (2009), exact `h(n)`, `n<50`), OEIS A048670/A049300,
  Costello and Hagedorn upper bounds, Cohen (maximal prime gap as an order statistic) and
  Cobeli-Zaharescu gap-distribution papers. Full Hagedorn table not opened (paywalled).

## New online searches this run (2026-10-03)

1. "autocorrelation gap sequence reduced residue system modulo primorial totatives anti-persistence"
   -> only definitions/general residue-system pages and arithmetic-autocorrelation papers for
   LFSR/feedback-with-carry sequences; no match for a totative-gap autocorrelation.
2. "Cobeli Zaharescu gaps between reduced residues distribution primorial correlation"
   -> surfaced the correlation-function line: Rudnick-Zaharescu, *The distribution of spacings
   between fractional parts of lacunary sequences* (arXiv:math/9912103); Aistleitner et al. (2021);
   "Distribution of gaps between the inverses mod q" (all correlations Poissonian); Xiong, pair
   correlation of rationals with prime denominators.

## Exact remaining gap

Those external results are **asymptotic and Poissonian** — they predict correlation -> 0 and do not
give a finite-period value or its rate at primorials. No source found computes the lag-1
autocorrelation of the reduced-residue gap sequence of a primorial over a full period; the nearest
content is the prime-gap second-moment work (Cohen) and the reduced-residue gap-distribution papers
(Cobeli-Zaharescu), neither of which addresses the arrangement/order of the gap sequence. The
positive content of this route — the empirical law `rho_1 ~ -1/(2 ln x)` — is new to the record; the
search cannot prove novelty (absence of a match is evidence about the search), and it is labelled
heuristic.

## Central uncertainty

The weakest unproved step is the mechanism: we measure `rho_1 < 0` but do not
derive it, so we cannot yet exclude that the value is a finite-size property of the small primorials
that decays to zero (the measured trend is consistent with either). The trend is over only five
points, and the `29#` lift that would extend it is untested here. Nothing here bounds `G2`; the
connection to the exponent is a hypothesis, not a claim.

## Next experiment

Is rho_1(x#) ~ -1/(2 ln x) (equivalently -rho_1*ln x -> 1/2) derivable from the inclusion-exclusion / sieve recursion that builds the (x_next)# reduced residues from those of x# by deleting the one lift in every x_next, and does 31# continue the law?

Two legs, both bounded. (1) Derivation: write the gap sequence of (x_next)# as the sorted merge of the lifts r + x#*k (k=0..x_next-1) of each x# reduced residue r, minus those divisible by x_next; express S1, S2 and C of the merged sequence (and hence rho_1) in terms of the x# level's S1,S2,C plus the inserted-desert / deleted-lift terms, and test whether 1 - rho_1 ~ 2 ln x follows, or whether the 1/2 is only empirical. (2) Measurement: run the same full-period segmented sieve (work/rho29_s.py generalized to 31#) at P=2.006e11, phi=3.066e10 (~9 CPU-min) and check that -rho_1(31#)*ln 31# stays near 1/2.

- Continue if: A recursion formula for rho_1((x_next)#) whose leading term is -1/(2 ln x) (with the measured six values reproduced), plus a 31# point inside [0.49,0.51] for -rho_1*ln x, would make the statistic predictable at any x without a full-period sieve and settle whether the arrangement effect is a law or a finite-size curve.
- Stop this attempt if: If rho_1(31#) leaves the 1/2 band, or if the recursion's leading term is not proportional to 1/ln x, report the contradiction and the measured 31# value as the record; a scoped obstruction (no log law) is a valid endpoint, not a fit.



## Required evidence

- [Return #2199](/projects/twin-primes/return/2199): recorded, recorded

Unaccepted premises remain conditional.

## Evidence behind continued investment

- [Return #2199](/projects/twin-primes/return/2199): recorded, recorded
- [Return #2207](/projects/twin-primes/return/2207): recorded, recorded

These investigations led to the current experiment. Their claims retain their own evidence grades.

## Investigation history

- [Return #2207](/projects/twin-primes/return/2207): promising. # evidence — job #4807 (route 180 first look)

## Instrument

`work/rho29_s.py` (stdlib + numpy): streams a segmented sieve of the interval `[1, P)` for
`P = x#`, marks multiples of each prime `2..x`, and accumulates, in exact integer Python
accumulators, `S1 = sum_i g_i`, `S2 = sum_i g_i^2`, `C = sum_i g_i g_{i+1}` over the **cyclic**
gap sequence (wrap gap `P - t_last + t_first` closes the cycle). `phi =` number of totatives.
At the end `rho_1 = (C*m - S1^2) / (S2*m - S1^2)`, `m = phi` — an exact integer ratio, float only at
the last step, so no cancellation error. Block size 4e6; memory O(block).

Run 2026-10-03 under `sah.py bounded --run run-2026-10-03-s --limit 1500`:
`terminated: true`, `survivors_seen: []`, exit 0. Output saved at `work/rho29_s.out`.

## Raw output

    x=23  P=    223092870  phi=    36495360  rho1=-0.159125934  secs=0.61
    x=29  P=   6469693230  phi=  1021870080  rho1=-0.150837713  secs=16.63

`phi(29#) = 1,021,870,080 = 28 * 36,495,360 = 28 * phi(23#)`, and `P(29#) = 29 * P(23#)`, both as
required. `S1 = P` for every level (the gaps sum to the period) — a built-in consistency check.

## Validation against the route's prior value

Return #2199 (job #4806) printed `x=23  rho1=-0.159126`. This instrument gives `-0.159125934`,
agreeing to the nine printed digits, so the new `29#` row is trustworthy on the same construction.

## Trend table (full-period, exact)

| x  | P            | phi           | rho_1        | -rho_1*ln x | ratio to prev |
|----|--------------|---------------|--------------|-------------|---------------|
| 11 | 2310         | 480           | -0.252340    | 0.6051      | —             |
| 13 | 30030        | 5760          | -0.210269    | 0.5393      | 0.833         |
| 17 | 510510       | 92160         | -0.186506    | 0.5284      | 0.887         |
| 19 | 9699690      | 1658880       | -0.170428    | 0.5018      | 0.914         |
| 23 | 223092870    | 36495360      | -0.159126    | 0.4989      | 0.934         |
| 29 | 6469693230   | 1021870080    | -0.150838    | 0.5079      | 0.948         |

The first five values are #2199's (independently reproduced here for 23#; 11#..19# quoted). The 29#
row is new. `-rho_1*ln x` is flat at ~0.50 for x >= 19.

## Nulls (from #2199, not rerun)

Permutation, palindromic-permutation and independent-thinning nulls at 11#..23# all give `rho_1 ~ 0`,
with the observed value far outside (z down to -1082 at 23#). The 29# value is negative as expected,
so the effect is not explained by the totative symmetry or by density alone.

## Checker

`work/rho29_s.py` reproduces the 23# value; a separate recorded run of the same script for 23# under
`time` gives the identical result. `S1 = P` holds exactly for both levels. No further claims.
- [Return #2199](/projects/twin-primes/return/2199): proposed. # evidence — job #4806 (gap-arrangement autocorrelation statistic)

## Instruments (run-local, house format: question in comments, then code)

- `work/gapshape_p.py` — builds the reduced residue system mod `x#` by a boolean sieve, computes
  `rho_1`, and three nulls: permutation (B = 2000, capped `2e8/n`), independent thinning (uniform
  size-`n` subset = `n` sorted uniforms), plus observed values at `x in {11,13,17,19,23}`.
  Run under `sah.py bounded --run run-2026-10-03-p --limit 900`, exit 0, `terminated: true`,
  `survivors_seen: []`. Output `work/gapshape_p.out`.
- `work/gapshape_lags_p.py` — adds the **palindromic-permutation** null (shuffle the first half of
  the gap sequence, mirror it, preserving both the multiset and the totative symmetry) and the lag
  profile `rho_k`, `k=1..8`; `x in {11,13,17,19}`. Run under `bounded --limit 600`, exit 0.
  Output `work/gapshape_lags_p.out`.

## Numbers (as printed)

    x=11  P=2310       phi=480       rho1=-0.252340  perm -0.001737+/-0.045018  palindrome +0.000091+/-0.063771 (z=-3.96)  thin -0.002012+/-0.045045 (z=-5.56)
    x=13  P=30030      phi=5760      rho1=-0.210269  perm -0.000020+/-0.013206  palindrome +0.000825+/-0.018699 (z=-11.29) thin -0.000753+/-0.013165 (z=-15.91)
    x=17  P=510510     phi=92160     rho1=-0.186506  perm -0.000017+/-0.003242  palindrome +0.000098+/-0.004501 (z=-41.46) thin +0.000069+/-0.003284 (z=-56.81)
    x=19  P=9699690    phi=1658880   rho1=-0.170428  perm -0.000103+/-0.000692  palindrome +0.000018+/-0.001203 (z=-141.65) thin +0.000066+/-0.000801 (z=-212.87)
    x=23  P=223092870  phi=36495360  rho1=-0.159126  perm -0.000030+/-0.000187  (palindrome not run)                        thin -0.000036+/-0.000147 (z=-1082.69)

    lag profile (19#): r1=-0.1704 r2=-0.0772 r3=-0.1034 r4=-0.0217 r5=+0.0398 r6=+0.0137 r7=-0.0418 r8=-0.0598
    lag profile (11#): r1=-0.2523 r2=-0.0003 r3=-0.1468 r4=-0.1045 r5=-0.0333 r6=+0.1370 r7=+0.0248 r8=-0.0584

## Control interpretation

- **Permutation** preserves the gap multiset exactly and randomises order: mean ~ 0 (correct for
  an autocorrelation under a random permutation of centred values, ~ -1/(n-1)). Observed is far
  below at every level.
- **Palindromic permutation** additionally preserves the symmetry `a <-> P-a` of the totatives
  (which makes the gap sequence a palindrome of its first `n-1` entries with wrap gap 2). The
  observed `rho_1` is still far outside (z = -3.96 ... -141.65): the negative autocorrelation is
  **not** a consequence of the symmetry alone.
- **Independent thinning** keeps only the density `phi(P)/P`; its `rho_1` is ~0, confirming the
  estimator is unbiased for an unstructured point set of this density.

## Exactness / reproducibility

`P`, `phi(P)` are exact integers; `rho_1` is computed in float64 from exact integer gaps (values
are `O(1)`; no overflow). The sieve is deterministic; only the nulls use the fixed seed
`20261003`. All raw outputs are saved beside the scripts. Total cost < 0.1 CPU-h.

## Claim ledger

- `rho_1(P) < 0` at `x=11,13,17,19,23` — **measured**, exact.
- H1 (positive clustering) falsified — **measured** (pre-registered rule fired on sign and band).
- `|rho_1|` decreasing in `x` over these five levels — **measured** (five points, monotone).
- No external source computes this statistic — **heuristic/scoped** search result (`prior_art.md`).
