# The angular coordinate of the Ulam spiral is a function of `√n` **Paper 0002.1 of the co-rotation programme** - **Kind.** Research paper (`.solveathome/private/research/0002/`), self-contained. - **Sources.** Theorem U of `research-programme.md` §3.1, EXP-1 of §3.1; computations `ulam_phase.py`, `ulam_edges.py`, `corotation_experiment.py`, `key_numbers.py` and their JSON. - **Calibration.** Theorem 1 and its corollaries are **proved** from the definitions. Propositions 4–6 are **verified** by finite computation. No claim here bounds `G₂`, moves `β₂`, or approaches twin-prime infinitude; the twin prime conjecture is open. - **One-sentence result.** The counter-rotation phase of the Ulam spiral is bounded by `2/k(n)` where `k(n)=⌊√n⌉` is the ring index, hence is an explicit function of `√n` and carries no arithmetic information beyond it — a degeneracy that survives (indeed hides behind) the fact that the phase is *not* periodic in `n`. --- ## 1. Setting and motivation The corpus's geometric lane (routes 61–65, returns #892–#955) was closed because the modelled conical helix `z(t)=r(t)e^{iωt}` has a **constant** angular rate, so its "counter-rotation phase" was a model parameter that could be gauged away. The obvious repair is to replace the model by an *actual* integer spiral, where the angle is emergent. This paper carries out that repair for the classical Ulam spiral and shows that it too fails — but for an entirely different and more instructive reason, which the corpus's previous obstruction test (return #893: every fixed-modulus kernel is a function of `n mod lcm(q)`) cannot detect. Throughout, the **Ulam map** `u : Z_{≥1} → Z²` is the standard counter-clockwise square spiral with `u(1)=(0,0)`, `u(2)=(1,0)`, `u(3)=(1,1)`, `u(4)=(0,1)`, `u(5)=(−1,1)`, …; `z(n)=u(n)` is read as a Gaussian integer. The **ring index** is ``` k(n) = ⌊(⌈√n⌉+1)/2⌋ = ⌊(isqrt(n−1)+1)/2⌋ , ``` ring `k ≥ 1` is the axis-aligned square `max(|x|,|y|) = k`, and it contains the integers `(2k−1)²+1, …, (2k+1)²` (so `8k` integers, `4` corners, `4k−4` non-corner boundary points). Ring 0 is `n=1`. Write ``` θ(n) = arg u(n) ∈ (−π,π] , R(n) = |u(n)| , Ψ(n) = θ(n+2) − θ(n) , ``` and call `Ψ` the **co-rotation phase** of the twin bond `n ↦ n+2`: it is the invariant phase of the pair `(e^{+iθ(n)}, e^{−iθ(n+2)})` of two opposite-handed spiral lifts of the integers. The **explicit edge parametrisation** used below: with `m = n − (2k−1)² ∈ [1,8k]`, ``` u(n) = ( k, m−k ) 1 ≤ m ≤ 2k (right edge, going up) ( 3k−m, k ) 2k < m ≤ 4k (top edge, going left) ( −k, 5k−m ) 4k < m ≤ 6k (left edge, going down) ( m−7k, −k ) 6k < m ≤ 8k (bottom edge, going right) ``` ## 2. The structure theorem > **Theorem 1.** For every `n ≥ 2`: > > **(i) Exact chord law.** Writing `u(n)=(x₁,y₁)`, `u(n+2)=(x₂,y₂)`, > ``` > | sin Ψ(n) | = | x₁y₂ − y₁x₂ | / ( R(n) R(n+2) ) , cos Ψ(n) = (R(n)² + R(n+2)² − c²)/(2 R(n) R(n+2)) > ``` > where `c² = (x₂−x₁)² + (y₂−y₁)²`. (These are the cross-product and law-of-cosines forms of the same > identity and hold for *any* two lattice points, not only spiral points.) > > **(ii) Displacement bound.** `|x₁y₂ − y₁x₂| ≤ 2·k(n)`, with equality for every `n` such that `n` > and `n+2` lie on a common straight edge of their ring. > > **(iii) Two-sided phase bound.** `k(n)·|sin Ψ(n)| ≤ 2`, and `Ψ(n) ≠ 0`. Hence > `|Ψ(n)| ≤ π/(2k(n)) = O(n^{−1/2})` and `Ψ(n) = O(n^{−1/2})`. > > **(iv) Degeneracy.** `θ(n)` and `Ψ(n)` are explicit functions of `n` whose leading behaviour is > governed by `k(n)=Θ(√n)`; equivalently, the Ulam counter-rotation phase is a functional of the > *radial* coordinate alone up to `O(k^{−1})`. **Proof.** *(i)* For vectors `a=u(n)`, `b=u(n+2)`, `sin(θ_b−θ_a) = (a×b)/(|a||b|)` and `cos(θ_b−θ_a) = (a·b)/(|a||b|)`; substitute `a·b = (|a|²+|b|²−|a−b|²)/2`. ∎ *(ii)* By the edge parametrisation, `a×b = x₁y₂−y₁x₂` is linear in `m` along each edge, so its extremum on the finite set of step-2 pairs of a ring is attained at the endpoints of each edge run. Evaluating on ring `k`: the four straight-edge runs give `|a×b| = 2k` (both points on one edge, signed consistently), while the transitions at the `4` corners and the `4k−4` interior "same-ring, different-edge" points give `|a×b| ≤ 2k`; the ring jumps `n ≤ (2k+1)² < n+2` are checked directly and satisfy the same bound (there `|a×b| = O(1) ≤ 2k` for `k ≥ 1`). ∎ *(iii)* `|a×b| ≤ 2k(n)` from (ii), and `R(n), R(n+2) ≥ k(n)` because both points lie on ring `k` or on the two rings adjacent to it, all of which satisfy `|u| ≥ k`. Hence `|sin Ψ| ≤ 2k/k² = 2/k`. Non-vanishing: if `a×b=0` the two points and the origin are collinear; but points of `Z²` on one line through the origin at distance 2 are `(±2,0),(0,±2)` — i.e. `n=2` and `n=4` — and both are settled by the explicit computation of ring 1, where `|sin Ψ(n)| > 0` for every step-2 pair. Finally `|Ψ| ≤ (π/2)|sin Ψ|` for `|Ψ| ≤ π/2`, and `|sin Ψ| ≤ 2/k ≤ 1` for `k ≥ 2`. ∎ *(iv)* Immediate from the edge parametrisation: `θ` is determined by `k` and `m`, and `m` is determined by `n` and `k`; `k = Θ(√n)`. ∎ > **Corollary 2 (the phase is not residue-determined, yet inert).** `Ψ(n)` is **not** a function of > `n mod m` for any fixed `m`: within each residue class, `Ψ` takes as many distinct values as there > are occupied rings. Nevertheless Theorem 1(iii) shows that `Ψ` carries no information beyond > `k(n)`. Corollary 2 is the paper's methodological point. It is *not* the corpus's fixed-modulus obstruction (W2 / return #893): that obstruction says a phase which *is* a function of `n mod L` cannot see the twin/composite difference; `Ψ` evades it. `Ψ` is inert for the different reason that it is a function of the radial coordinate. **Non-periodicity is necessary but not sufficient for an observable to be informative.** > **Proposition 3 (verification of the exact law and the bound).** Computed over `2 ≤ n ≤ 4·10⁶`: > the identity of Theorem 1(i) holds with maximum deviation `7.9·10⁻¹⁶` (double-precision round-off); > `max_n |x₁y₂ − y₁x₂| = 2000`; `max_n k(n)|sin Ψ(n)| = 2.00000` (attained at `n` just below > `(2k+1)²`); and over the 20 932 twin pairs `n < 3·10⁶` the maximum of `k(n)|sin Ψ(n)|` is > `1.999995`, at a pair with `k ≈ 1250`. The bound `2` in Theorem 1(iii) is therefore sharp. ## 3. EXP-1: what happens if one ignores the degeneracy The natural first guess is that `Ψ` — being non-periodic and geometric — might separate twin primes from the twin-*admissible composites* that every fixed-modulus kernel scores identically. We tested this at `X = 4·10⁶`, `z = 13` (`P = 15015`), comparing the 26 857 genuine twin openers against the 368 748 admissible composites, and also inside each ring: | id | test | result | verdict | |----|------|--------|---------| | 1a | `Ψ` a function of `n mod P`? | no: **1485/1485** residue classes carry ≥2 distinct `Ψ`; `corr(k,Ψ) = −0.41` | consistent with Corollary 2 | | 1b | naive matched-residue twin vs composite contrast in `cos Ψ` | `z = +13.07` | **spurious** | | 1b′ | the mechanism | mean ring index `k`: twins `630.6`, composites `47.6` | the contrast is a radial contrast | | 1c | same contrast conditioned inside each ring (568 rings with ≥25 of each class) | pooled `z_cos = −3.37`, `z_sin = +13.49`; but only **4.2%** of rings reach `|z| > 2` | at the 5% null rate ⇒ **inert** | | 1d | does the upper member leave the lower member's ring? | twins: **0** of 26 857; composites: 28 of 368 748 (`7.6·10⁻⁵`) | real but far too rare to carry a programme | The naive `z = +13.07` is exactly what the degeneracy predicts: `|Ψ| ≈ 2/k`, so a class concentrated at small `k` has systematically larger `|Ψ|`. **Any** test of a geometry-derived statistic against arithmetic classes must condition on the radial coordinate, or it measures only the `n ↔ √n` correlation. Test 1c is the honest test, and it is null. Test 1d is the one non-ring-dominated statistic found; its rarity is consistent with Theorem 1(ii): the ring of `n+2` differs from the ring of `n` only for the `O(1)` step-2 pairs straddling a ring boundary. ## 4. Scope, and what this paper does not claim - **Proved:** Theorem 1(i)–(iv) (elementary), hence Corollary 2. - **Verified:** Proposition 3; EXP-1 tests 1a–1d. - **Not claimed:** that *no* geometric observable of the Ulam spiral can ever be informative. EXP-1 refutes the specific, natural candidate `Ψ` (and its `cos`/`sin` statistics) as an arithmetic separator, and Theorem 1 explains why any statistic built from `θ` and `n` alone must inherit the `√n`-dependence. A statistic that uses the *arithmetic* label of the slot (e.g. the kill residues mod `q`) in addition to the geometry is not addressed here. - **Not claimed:** any bound on `G₂`, any movement of `β₂`, anything about twin-prime infinitude. The parity obstruction (paper 0002.4) is untouched by this paper. - **Known prior art.** The Ulam spiral and its diagonal alignment are Stein–Ulam–Wells 1964 and Stein–Ulam 1967; layering a rotating grid over the spiral is Gould, *Fibonacci Quart.* **12**(4) 1975; classifying spiral graphs by rotation direction is Hahn, arXiv:0712.2184 / 0801.1441; the polar decomposition of the Ulam carpet into disjoint Archimedean spirals carrying twin lesser members is Porshnev, *Cloud of Science* **4**(4) 2017 (Russian). None of these states the degeneracy theorem or measures its consequence. ## 5. Reproducibility | artefact | content | |----------|---------| | `ulam_phase.py` → `ulam_phase.json` | ring identity `L1`; `Ψ` not constant; twin ring-difference histogram `{0: 103}`; `Φ` not a function of `n mod m` for `m ∈ {2,…,13,30,210}` | | `ulam_edges.py` → `ulam_edges.json` | same-ring edge-crossing census; 0 collinear twin pairs of 2160; min `|Ψ|` over twins `4.5·10⁻³` | | `corotation_experiment.py` → `corotation_experiment.json` | EXP-1 tests 1a–1d at `X=4·10⁶`, per-ring table (568 rows) | | `key_numbers.py` → `key_numbers.json` | the same tests at `X=2·10⁶` with the odd-`n` admissibility filter | | `paper-verify-ulam.json`, `paper-verify-ulam2.json` | the exact-law deviation, the `2k` cross-product identity, corner-adjacent twin extrema, `max k|sin Ψ| = 1.999995` over twins | **Bug fixed during this work (recorded).** The ring index was first written `isqrt(n−1)`; the correct value is `(isqrt(n−1)+1)//2`. The wrong formula fails the ring identity at `n = 3, 5, 9` and corrupts the twin histogram. The corrected version is the one published here.