README.md
4.2 kB · markdown
three-base-thin
- Computes the three-base thin set
E = {n : every base-3 digit <= 1, every base-5 digit <= 2, every base-7 digit <= 2}exactly, and the wider set with the base-7 bound at3, which is{k : binomial(2k, k) is prime to 105}, A030979. - Exact integer arithmetic throughout,
num-bigintabove128bits; no sampling, no fit. - The walk enumerates the base-3 side, whose members are the subset sums of distinct powers of
3, from the top power down. Once the powers3^kand above are chosen the remaining addition is at most(3^k - 1)/2, so withjleast such that5^j > (3^k - 1)/2the high partfloor(n / 5^j)of everynstill reachable is one of two consecutive integers, and the branch dies when neither of them has all its base-5 digits inside the bound; base7cuts the same way. Membership in the base-3 set holds by construction and is never tested. - Also prints the three dimensions of
E,log_3 2,log_5 3andlog_7 3, the base-7 dimensionlog_7 4of the wider set, the three pair budgetsdim_i + dim_j - 1, the two triple budgetssum dim - 2, and the criterionA/(p-1) + B/(q-1)of Erdos, Graham, Ruzsa and Straus for each pair. A dimension prints to the nearest six places, a budget rounds up, an effective exponent truncates down.
VERBS
budgetprints the four dimensions, the three pair budgets, the triple budget for the thin set and for the wider one, and the five values of the infinitude criterion. Runtime under0.01s.controlrebuilds the members below10^8twice, once by the pruned walk and once by scanning every integer against all three digit rules, at both base-7 bounds, and rebuilds the23terms A030979 publishes. Runtime1.9s.seven Mprints the members ofEbelow7^Mwith the node count. Runtime under0.01s atM = 17.reach levelprints the members ofEbelow3^levelwith the node count. Runtime3.02s at level 20000,13.60s at level 40000 and61.48s at level 80000, the last on about3GB, which is the wall: the stored powers costTheta(level^2)bits and the node count grows near21 level.wide levelandten Xdo the same at base-7 bound3, below3^leveland below10^X, printing the count, the largest member and the effective exponentlog(count)/log(height). Runtime0.09s atX = 70and39.32s atX = 140.
RUN
CARGO_BUILD_JOBS=4 cargo run --release -p three-base-thin -- budget
CARGO_BUILD_JOBS=4 cargo run --release -p three-base-thin -- control
CARGO_BUILD_JOBS=4 cargo run --release -p three-base-thin -- seven 17
CARGO_BUILD_JOBS=4 cargo run --release -p three-base-thin -- reach 80000
CARGO_BUILD_JOBS=4 cargo run --release -p three-base-thin -- ten 70
CARGO_BUILD_JOBS=4 cargo run --release -p three-base-thin -- ten 140
CARGO_BUILD_JOBS=4 cargo test -p three-base-thin,7tests,1.18s after the build.
READS
Ebelow7^17 = 232630513987207:0, 1, 3186, 3187, 20007,333nodes.Ebelow3^80000, a height of38170decimal digits: the same five,1710789nodes.- The wider set below
10^70:1374members, the length of the table A030979 calls complete to10^70. Below10^140:216020members. - Dimensions
0.630930,0.682606and0.564575forE, and0.712414for the base-7 side of the wider set; pair budgets0.313536,0.195505,0.247182; triple budgets-0.121889thin and0.025951wide; criterion1.000000at(3, 5)and0.833333at(3, 7)and at(5, 7). - Effective exponents of the wider set
0.044828at10^70and0.038103at10^140, both above0.025951and falling.
WITNESSES
cobham.md:87the three dimensions ofEcobham.md:88andcobham.md:89the pair budgets and the triple budgetcobham.md:91andcobham.md:92the infinitude criterion at each paircobham.md:94the members below7^17cobham.md:95the members below3^80000cobham.md:96the scan control below10^8cobham.md:97the fourth dimensionlog_7 4 = 0.712414and the wider budget0.025951cobham.md:99the23published terms rebuilt, the1374below10^70, the216020below10^140and the two effective exponents