research/lab/rs/farey-discrepancy
1 directory and 2 files in research/lab/rs/farey-discrepancy.
Farey Discrepancy
Three verbs on one object: the node set of the scale stack, and the Franel-Landau discrepancy read on it. With rho_1 < ... < rho_m the nodes of a set in (0,1] ascending and delta_j = rho_j - j/m, the meter is S2 = sum delta_j^2 and S1 = sum |delta_j|.
VERBS
stack- the lit nodes of the scale stack are the Farey nodes: the literal reduced lines of every scalen <= Q, the sorted window list and the mediant walk are one set, sized bysum_{k<=Q} phi(k), atQ = 10, 30, 60, 125. Each nodea/bis drawn byfloor(Q/b)of those scales, and scalenlightsphi(n)nodes no earlier scale lit.meter- the Franel-Landau meter onF_Q, seven rungsQ = 125 .. 8000:S2*Q,S1/sqrt(Q)and the local exponentsd ln S / d ln Q, with the sorted window route cross-checked against the mediant walk at the first four rungs. The top rung isQ = 8000with 19455782 nodes.design- the same meter restricted to a digit designS_F, the whole numbers whose every base digit lies in a digit set. Two conventions,aandbboth inS_F(strict) andbalone inS_F(denominator), against the unrestricted control, at base 3{0,1}toQ = 3^11and base 10 without the digit 9 toQ = 10^5. Per lane it printsS2andS1with their consecutive-rung ratios and local exponentse_2ande_1, never a fit; the transplanted normalisersS2 Q^(e-alpha)andS1/Q^(alpha/2); the constantsS1/cardandS2/card; and the widest gap between consecutive nodes with its left endpoint.
HOW IT COUNTS
- One Stern-Brocot mediant walk per rung enumerates
F_Qin ascending order; the walk itself carries no node list and the three lanes filter it as it runs, so each keeps its own rank and the restricted lanes ride the control for free. The verb's memory is theO(Q)sieves it builds per rung, a few megabytes at the top. - The count is checked against a sieve that never enumerates a fraction:
sum_{b in S_F} phi(b)for the denominator convention, andsum_{b in S_F} sum_{d | b} mu(d) #{multiples of d in S_F up to b}for the strict one. Thechkcolumn is that comparison,PASSat every rung of every table. - Rungs are powers of the base so the design's set is self-similar at each one.
- The cut is the control's cost, one walk step per node of
F_Q: 9538759028 steps atQ = 3^11, 3039650754 atQ = 10^5.
RUN
bash scripts/cargo.sh cargo run --release -p farey-discrepancyfrommrlyprod/runs all three verbs; append-- stack,-- meteror-- designfor one.stackandmetertake under a second at 0.7 GB peak;designtakes a minute at a few megabytes. Prints only, writes nothing.bash scripts/cargo.sh cargo test --release -p farey-discrepancychecks both restricted counts against brute-force enumeration at base 3, base 10 without 9 and the full set.
WITNESSES
farey.mdWHERE THE LINES LAND - brightnessfloor(Q/b)on every lit node, and the node table atN = 30.farey.mdPRIMES ARE THE MAXIMALLY NOVEL SCALES - the new nodes of scalennumberphi(n)forn = 2..30.farey.mdFRANEL AND LANDAU, 1924 -card F_Q = sum phi(k)atQ = 10, 30, 60, 125.farey.mdTHE METER READS WHAT RH PREDICTS - nodes,S2*Q,S1/sqrt(Q)and the local exponents at the seven rungs.farey.mdTHE METER ON A DIGIT DESIGN - the two exponent tables, the count checks, the constantsS1/cardandS2/card, the widest gap between consecutive nodes, and theS2*QandS1/Q^(alpha/2)readings of the denominator lane.farey.mdFAREY ORDER IS THE STACK, NOT THE DESIGN - brightness by literal stacking atQ = 30on all 278 lit fractions and up toQ = 125.
- src/2 items
- Cargo.toml128 B
- README.md3.6 kB