"""Exact, independently organized checks for the two added cycle censuses.""" from pathlib import Path from itertools import combinations, product from collections import Counter from functools import lru_cache from fractions import Fraction import json, re, sys import sympy as S ROOT=Path(__file__).resolve().parents[1] sys.path.insert(0,str(ROOT/'n8_aaa_complete/code')) from exact_rows import profiles def read_exponents(name): t=(ROOT/'report'/name).read_text() t=t.split(r'\begin{pmatrix}')[1].split(r'\end{pmatrix}')[0] a=[[int(x) for x in row.strip().split('&')] for row in t.split(r'\\') if row.strip()] assert len(a)==8 and all(len(row)==8 for row in a) return a def admissible(q,vals,parts): @lru_cache(None) def rec(v,ps): if not ps:return not v for p in set(ps): if q%p:continue # The cycle containing the first occurrence can be rotated to start there. cycle=Counter((v[0]+k*(q//p))%q for k in range(p)) cc=Counter(v) if any(cc[x]