research/lab/rs/coprime-terms
3 directories and 3 files in research/lab/rs/coprime-terms.
coprime-terms
- Exact
A(level), the points of a base-3 mask design at levellevelwith coprime coordinates, without walking thefill^levelpoints: the Menger sponge tolevel = 18, the Sierpinski carpet and the Vicsek plus tolevel = 20. - Mask form: with
mask(x)the set of base-3 positions wherexhas digit 1 (a digit away from 1 for the plus), a point lies in the level set iff its coordinate masks are pairwise disjoint. - Mobius over the common divisor with the base prime peeled:
A(level) = W(level) - W(level-1)whereW(level) = Sum_{m < 3^level, gcd(m,3) = 1} mu(m) (N_level(m) - 1), sinceN_level(3m) = N_{level-1}(m)whenever the zero digit vector is filled; the plus hasA(level) = W(level)and no-1. N_level(m)is a pairwise-disjoint count over the masks of theY = ceil(3^level / m)multiples ofm, on at most2^levelmasks whatever the box; the sponge splits its moduli byYover five counters, each cheapest in its band by measurement.tail,Y <= 3: closed formsN - 1 = 3 + 4 [mask(m) = 0]forY = 2and6 + 7 [mask(m) = 0] + 7 [mask(2m) = 0] + 6 [mask(m), mask(2m) disjoint]forY = 3, so the top two bands ofW(level)are Mertens sums over automatic sets.bitset,Y <= (512 level 2^level)^(1/3): oneY-bit row per multiple marks its disjoint partners andN = 6 T + 3 z (Y - 1) + z,Tthe popcount sum of row pairs above the diagonal andzthe zero-mask multiples; aboutY^3 / 1000cycles againstY^3 / 100for the nested loops it replaces.rows,U <= 6 sqrt(level 2^level)distinct masks: oneu16zeta transformgof the mask histogramc, then2 Sum_{a < b disjoint} c_a c_b g(complement(a | b))plus the zero-mask diagonal, the disjoint pairs read off bitset rows built four masks per NEON lane inside buckets keyed by the top six bits.cube, the rest:u32ranked zeta transforms truncated at rankK ~ level/2with the rare heavier masks folded back by subset enumeration, thenN = Sum_T <c_hat(complement T), Delta[sq(T)]>per setT,sqthe square of the rank polynomial andDeltaits binomial difference table, in wrappingu64whereY^3 < 2^64andu128otherwise.residue: the automaton on(Z/m)^3form <= 16; the earlier nested-loop, zeta and ranked-convolution counters stay as references inside the gate.- Cost:
3^levelmoduli a level; thebitset/rowscrossover costs3^level (level 2^level)^(2/3) / 8and therows/cubebalance3^level level 2^(level/2)cycles, so the level ratio interms/menger.txtis4.32fromlevel = 17(28.317 s) to18(122.294 s) on eight threads,3.7xand3.8xthe104 sand463 sof coprime.md:330, and tends to4.76only pastlevel = 22. checkgates the engine: direct enumeration tolevel = 6for the sponge and8for the plane designs, every counter agreeing with every other on every modulus to level 8, each counter pinned alone agreeing with auto to level 8 (bitset), 10 or 11, 45 probed moduli at the sample level across counters, two pinned level-19 probes for theu64cube gate (m = 440) and theu32rows branch (m = 3^8 + 1), the3mpeel identity, and the fillN_level(1) = fill^level.terms/holds the three ladders with seconds per level and their b-files.
RUN
CARGO_BUILD_JOBS=4 cargo run --release -p coprime-terms -- terms menger 18 8- Arguments: design (
menger,carpet,vicsek), top level, threads. -- check menger 6 14runs the gate battery;-- profile menger 16 8prints seconds perlog2 Yband and counter for one level;cargo test --release -p coprime-termspins the stored terms.- The sponge ladder to
level = 14takes 1 s, tolevel = 18about 2.5 min (terms/menger.txt).
WITNESSES
- coprime.md:330: the sponge ladder
A(10) .. A(18), ending215134797774716879278017, with the 104 s and 463 s timings of the previous engine. - research/claims/:161: the same ladder and the gate battery.
- A399364: DATA
level = 0..17and the b-fileterms/menger_bfile.txttolevel = 18.