#!/usr/bin/env python3 """job #1383 -- the T29 column K*({p}) at SAMPLED primes (level 29 is the largest reachable level). Instrument: period_check.c UNCHANGED. Tile D_29 = 214,708,725 slots; period 29#*p = 2.006e11 positions. Cost model from #1377: ~12 s to sieve the tile per invocation + p x 0.4 s of block scan, so the sampled set below is ~7 min (0.12 CPU-h of the 0.25 offered); the full column to p = 131 would be ~18 min. """ import pathlib, subprocess, sys, time BASE = pathlib.Path(__file__).resolve().parent BIN = BASE / "period_check" SAMPLES = [31, 37, 41, 61, 101, 109, 113, 127, 131] print("T29 sampled column (phase-max K*({p}) at level 29)") vals = [] for p in SAMPLES: t = time.time() r = subprocess.run([str(BIN), "29", str(p)], capture_output=True, text=True) k = None for line in r.stdout.splitlines(): if "K*(Q)=" in line: k = int(line.split("K*(Q)=")[1].split()[0]) vals.append((p, k)) print(f" p={p:4d} K*={k}") print(f" p={p:4d} {time.time()-t:.1f}s", file=sys.stderr) seq = [v for _, v in vals] recov = sum(1 for i in range(1, len(seq)) if seq[i] < seq[i-1] and any(w > seq[i] for w in seq[i+1:])) last_gt1 = max([p for p, v in vals if v > 1], default=None) plateau = next(((p) for p, v in vals if v == 1 and all(w == 1 for _, w in vals[vals.index((p, v)):])), None) print(f" recoveries among samples: {recov} last p with K*>1: {last_gt1} final 1-plateau from: {plateau}") print(f" plateau/level ratio: {plateau}/29 = {plateau/29:.2f}" if plateau else " no plateau in sample") print(" ladder ratios 11/5=2.2 23/11=2.09 37/13=2.85 59/17=3.47 71/19=3.74 107/23=4.65")