The lonely runner conjecture
Find integer speeds for which no moment leaves every runner at least 1/(n+1) from the start, or prove the conjecture, now proved for n ≤ 14.

| 1 | """A lonely moment, checked exactly: four runners with speeds 1, 3, 4, 9 laps per unit time leave 0 together, where a |
| 2 | fifth runner stands still. At t = 5/12 every moving runner is at least 1/5 = 1/(n+1) of a lap from 0, so the stretch the |
| 3 | conjecture promises to empty is empty (the field's colour). Faint trails show the last 0.02 time units of each run, so |
| 4 | their lengths are the speeds.""" |
| 5 | import math |
| 6 | from fractions import Fraction |
| 7 | from pathlib import Path |
| 8 | |
| 9 | import kit |
| 10 | |
| 11 | V, t = (1, 3, 4, 9), Fraction(5, 12) |
| 12 | n = len(V) |
| 13 | gap = lambda t: min(abs(t * v - round(t * v)) for v in V) # distance of the nearest runner to 0, in laps |
| 14 | assert gap(t) >= Fraction(1, n + 1), gap(t) # 1/4 here |
| 15 | |
| 16 | cx, cy, r = kit.W / 2, 136, 108 |
| 17 | P = lambda u: (cx + r * math.sin(2 * math.pi * u), cy - r * math.cos(2 * math.pi * u)) # 0 at the top, clockwise |
| 18 | arc = lambda a, b: [P(a + (b - a) * i / 40) for i in range(41)] |
| 19 | body = kit.circle(cx, cy, r, 'faint-s', ' stroke-width="2"') |
| 20 | body += kit.polyline(arc(-1 / (n + 1), 1 / (n + 1)), 'f-s', 7) # within 1/(n+1) of 0: empty at this moment |
| 21 | body += ''.join(kit.polyline(arc(float(t * v) - 0.02 * v, float(t * v)), 'faint-s', 6) for v in V) |
| 22 | body += ''.join(kit.dot(*P(float(t * v)), 9) for v in V) |
| 23 | body += kit.dot(*P(0), 10, 'f') |
| 24 | kit.write(__file__, 'mathematics', body, label=f'speeds 1,3,4,9 · all ≥ 1/{n + 1} lap from the still one') |