A corrected formula for all parameters

What Lean checks

The actual extremal densities and circle maxima for {1,k,k+5} and {1,k,k+7} are classified for every positive k, including every small exception. Explicit periodic optima, the exact Conjecture 39 discrepancy, and infinitely many strict counterexamples are proved.

For every integer k≥1k\ge1 and each s∈{5,7}s\in\{5,7\} we determine the maximum upper density α(D)\alpha(D) of a set of integers avoiding all differences in D={1,k,k+s}D=\{1,k,k+s\}. For both families this proves Haralambis's prediction α(D)=κ(D)\alpha(D)=\kappa(D), where κ(D)=maxt∈[0,1]mind∈D∥dt∥\kappa(D)=\max_{t\in[0,1]}\min_{d\in D}\|dt\| and ∥⋅∥\|\cdot\| is distance to the nearest integer. The prediction for an arbitrary triple is open in the sources checked. Liu and Robinson, Conjecture 3

For gap five, use Theorem 1 of the original proof and the small cases below. For gap seven, the following table gives the density for k≥8k\ge8 outside the eight listed small cases. Each pair (P,C)(P,C) denotes (4P−C)/(9P)(4P-C)/(9P).

kmod9k\bmod9 0 1 2 3 4 5 6 7 8
Entry (k+8,5)(k+8,5) 4/94/9 (k+8,4)(k+8,4) (2k+7,7)(2k+7,7) (k+8,3)(k+8,3) (k+8,7)(k+8,7) (k+8,2)(k+8,2) (k+8,6)(k+8,6) (k+8,1)(k+8,1)

At k≡5(mod9)k\equiv5\pmod9, k≥41k\ge41, the answer is (4k+25)/(9k+72)(4k+25)/(9k+72). The published preprint's prediction exceeds this by (k−41)/(9(k+1)(k+8))(k-41)/(9(k+1)(k+8)). Thus the two formulas agree at 41 and differ at every k=50,59,68,…k=50,59,68,\ldots. At k=14,23,32k=14,23,32 the original prediction holds. The other eight residue branches agree with the preprint throughout its stated domain. Carraher et al., Conjecture 39

For k=1k=1 the value is 3/73/7 at gap five and 4/94/9 at gap seven, by the residue-11 argument below. The remaining small cases complete the two formulas.

Gap Values of kk Densities in the same order
5 2, 3, 4, 5, 7, 12 1/3,4/11,2/5,1/3,3/8,5/131/3,4/11,2/5,1/3,3/8,5/13
7 2, 3, 4, 5, 6, 7 3/10,5/13,2/5,6/17,3/7,1/33/10,5/13,2/5,6/17,3/7,1/3
7 9, 11, 14, 16, 18, 23, 25, 32 2/5,5/12,2/5,7/17,8/19,5/12,11/26,14/332/5,5/12,2/5,7/17,8/19,5/12,11/26,14/33

Constructions and the Lonely Runner value

For rational t=a/Pt=a/P in lowest terms, put h=Pmind∈D∥dt∥h=P\min_{d\in D}\|dt\|. The residues axmodP<hax\bmod P\lt h define an independent set of density h/Ph/P. Rational times are dense and the objective is continuous, hence κ(D)≤α(D)\kappa(D)\le\alpha(D). The constructions below attain the stated density at a particular time. Together with the upper bounds, they imply equality. The gap-five constructions are in the original proof.

At gap seven and residue 11, take t=4/9t=4/9. All forbidden differences are ±1\pm1 modulo 9. The eight consecutive sites i,…,i+7i,\ldots,i+7 and the site i+k+7i+k+7 form a nine-cycle, which contains at most four occupied sites. Averaging gives the reverse inequality. This argument also applies to k=1k=1. For gap five use the seven-cycle and t=3/7t=3/7.

For gap-seven residues 0,2,4,5,6,7,80,2,4,5,6,7,8, put P=k+8P=k+8, h=(4P−C)/9h=(4P-C)/9 and t=h/Pt=h/P. The table makes hh integral. Modulo PP, the forbidden steps multiplied by hh are hh, h+Ch+C and −h-h. They all belong to [h,P−h][h,P-h] since P≥7CP\ge7C. In the seven classes the first eligible kk values are respectively 27,20,13,41,15,34,827,20,13,41,15,34,8, where this inequality can be checked directly. It persists as kk grows.

For residue 33 put P=2k+7P=2k+7, h=(4P−7)/9h=(4P-7)/9 and a=h+1a=h+1. Writing k=9j+3k=9j+3 gives h=8j+5h=8j+5 odd. Since 9a=4P+29a=4P+2 and PP is odd, gcd(a,P)=1\gcd(a,P)=1. The identity 2(ka−h)=P(h−3)2(ka-h)=P(h-3) gives ka≡h(modP)ka\equiv h\pmod P. Also (k+7)a≡−h(k+7)a\equiv-h and h≤a≤P−hh\le a\le P-h. Thus t=a/Pt=a/P works.

For each of the 20 small cases the Python verifier exhibits a rational time by enumerating denominators that are sums of two forbidden differences. It checks the three modular distances, the cardinality and independence of the residue set. Using the strict-prefix lemma from the original proof, it then excludes a denser independent set by direct enumeration on a specified interval of length at most 128. The denominators used for the construction suffice because the verifier finds a witness. Small cases and finite-word verifier

The upper bound at gap seven

The shortening proof for gap five applies with the following constants and local counts. For clarity, the two cycles at index ii consist of the sites i,…,i+7,i+k+7i,\ldots,i+7,i+k+7 and i+k,…,i+k+7,ii+k,\ldots,i+k+7,i. Each has nine vertices. Subtract each occupation count from four, and call the sum of the two deficits did_i. These nonnegative integers have mean 8−18ρ8-18\rho at density ρ\rho. A better periodic set therefore yields a rotation with P∑i<tdi<HtP\sum_{i\lt t}d_i\lt Ht at every 1≤t≤P1\le t\le P, where the sum starts at zero and H=2C≤14H=2C\le14. Periodic approximation covers arbitrary sets.

Use rows of width kk with states storing the last seven bits of each row. For P=Rk+eP=Rk+e, take (R,e)=(1,8)(R,e)=(1,8) or (2,7)(2,7) as the table specifies. The finite strip construction, seam equalities, final ee transitions and prefix tests are exactly those defined in the gap-five proof, with the history length seven and the nine-cycle costs above. In the two-row graph there are 577 states. The states with both a four-step incoming and a four-step outgoing zero-cost walk induce a single directed nine-cycle. The verifier generates all states and checks these assertions. In any 17 zero steps, states 4 and 13 therefore agree. The indices work simultaneously for both adjacent pairs of a three-row strip.

For k>4000k>4000, divide the first kk columns into HH segments at ⌊bk/H⌋\lfloor bk/H\rfloor, and reserve the first and last 17 columns of each segment. Every interior has length at least ⌊4001/14⌋−34=251≥17H\lfloor4001/14\rfloor-34=251\ge17H. There are at most H−1H-1 positive columns in total. If every zero run in one interior had length at most 16, its length would be at most 16H+(H−1)16H+(H-1). Hence each interior admits deletion of a closed nine-step walk of zero cost, leaving the seams and the remembered first ee bits intact.

Set k′=k−9Hk'=k-9H and P′=Rk′+eP'=Rk'+e. Write jR=bH+ujR=bH+u, 0≤u<H0\le u\lt H. The checkpoint ⌊jP/H⌋\lfloor jP/H\rfloor occurs within ee columns to the right of segment boundary uu in row bb, or within the final extension at j=Hj=H. Exactly 9(bH+u)=9jR9(bH+u)=9jR steps preceding it have been deleted in row order. Its cost is unchanged at the shortened checkpoint ⌊jP′/H⌋\lfloor jP'/H\rfloor. By monotonicity these checkpoints imply all strict prefix bounds. The new parameter has the same residue modulo nine. A step from above 4000 lands at or above 3875, so all small exceptions are avoided.

Iteration reaches k≤4000k\le4000. The C++ verifier excludes such a path at all 3,541 required base parameters from 8 through 4000 and accepts the relaxed-budget controls. This proves the upper bound in all remaining cases. Strip verifier

The supplementary tables of Carraher et al. already contain many exact small values and construction bounds. The classification gives a uniform upper bound and the corrected branch for all kk. A related result of Pandey treats {a,b,a+nb}\{a,b,a+nb\} under the hypothesis a<ba\lt b. The representation a=k,b=1a=k,b=1 of the present families falls outside that hypothesis for k>1k>1. Original data, Pandey, Theorems 2.1, 3.1 and 4.1