FindingMath

A sum of gap lengths tells when a ruler can reach the length predicted by counting pairs

Version 1 Published 2026-11-20 DOI 10.5281/zenodo.24406311

Importance (self-rated) Notable

Resolves the exact first-attainment threshold for all excess-mark parameters, a specific open question in generalized Golomb-ruler extremal theory.

You are reading version 1. Read the latest version (2).

Why it matters

If repeated spacings are allowed, how tightly can marks be packed on a ruler? We found the exact repetition allowance at which a simple counting limit becomes achievable, and a construction that reaches it for every excess-mark count. This settles a mathematical packing question, rather than a claim about the performance of physical rulers.

How short can a ruler be if its marks must sit at whole numbers and only a limited number of pairs may share the same spacing? Counting pairs one unit apart gives a length below which the marks cannot fit. Reaching that length is harder: the same marks must satisfy the repetition limit at every spacing.

We find exactly when the counting bound can be reached. Let g be the repetition limit and b the number of marks in excess of that limit, so the ruler has g+b marks. For each fixed b\ge2, the first limit that works is g=B(b+1)-2b, where B(b+1) is the sum of the first b entries in the list 2,3,3,4,4,4,5,5,5,5,\ldots. Every larger limit works as well. For example, with four more marks than the repetition limit, the first limit that works is four. We reach the bound by arranging the empty positions so that enough pairs are removed at each spacing, even near the ends of the ruler.

1. The length bound and when it is reached

A ruler is a finite set of integer marks; its diameter is the distance between its outermost marks. For a set of marks X, the number of pairs separated by a positive distance d is

r_X(d)=\#\{x\in X:x+d\in X\}\quad(d>0).

A g-Golomb ruler satisfies r_X(d)\le g at every positive distance. Ordinary Golomb rulers have g=1, so every spacing is distinct. Write G(g,n) for the smallest diameter with n marks. We consider n=g+b, with b\ge2. In an interval of diameter D, the D+1-n unoccupied integer positions can each remove at most two distance-one pairs. Thus r_X(1)\ge 2n-D-2, giving

G(g,g+b)\ge g+2b-2.

The first-attainment threshold g_0(b) is the least positive integer g for which equality holds.

A related object, a linear-multiplicity (LM) ruler, allows at most d-1 pairs at distance d. Its adjacent gaps must be at least two, with at most s-1 gaps of length s. Let B(n) be the sum of the first n-1 terms of

2,\ 3,3,\ 4,4,4,\ 5,5,5,5,\ldots.

Adding these shortest permitted gaps gives a lower bound on the diameter of an LM ruler with n marks.

Gupta and O’Bryant [3] study how short rulers can be when many pairs may share a spacing. Williams [1] found how the first-attainment threshold grows for large b, tabulated its first 12 values and asked for its exact value. Ariel Williams [2] also gave explicit lists of adjacent gaps, called AW schedules. They give an LM ruler of diameter B(n) for every size n. We rearrange its gaps and use the internal marks of the resulting sparse ruler as the empty positions, or holes, in a dense one. A hole near an end can remove fewer pairs at a given distance than a hole in the interior. Thus the order of the gaps matters even when their sum is fixed.

Theorem. For every integer b\ge2,

g_0(b)=B(b+1)-2b.

To evaluate the sum, let k be the largest gap among its terms and r the number of copies of that gap. These are the unique integers k\ge3 and 1\le r\le k-1 with

b=\binom{k-1}{2}+r.

Then

g_0(b)=\frac{(k-1)(k-2)(k-3)}3+(k-2)r.

The construction gives a ruler at the threshold for each b. To increase g while keeping b fixed, add a mark one unit beyond the right endpoint. This increases the diameter by one and adds at most one pair at each spacing, so equality persists.

For example, b=4 gives k=4,r=1, so the threshold is g=4. The sparse ruler has successive gaps (3,2,3,4), with marks (0,3,5,8,12). Removing its internal marks from the integers 1 through 11 gives (1,2,4,6,7,9,10,11), an eight-mark ruler of diameter ten with no spacing repeated more than four times.

2. Why a smaller repetition limit cannot work

If a ruler reaches the length bound, its holes, together with two points just outside the ruler, must form an LM ruler. The length needed for those points gives a lower bound on the repetition limit.

Suppose a g-Golomb ruler X with g+b marks has diameter D=g+2b-2, with endpoints 0 and D. Let J be its set of b-1 holes. To count pairs at distance d, start with the whole interval and remove pairs that touch a hole. A pair joining two holes would be removed twice, and a hole near an end may have no partner on one side. Correcting for both gives, for 1\le d\le D,

r_X(d)=g+1-d+r_J(d)+\#\{j\in J:j<d\}+\#\{j\in J:j>D-d\}.

Consequently the last three terms sum to at most d-1.

Adjoin outside points -1,D+1 to J. Each new endpoint-to-hole pair of distance d\le D is included in the corresponding boundary count above. At distance D+1 there are no pairs; at distance D+2 there is just the outside-endpoint pair. Thus the augmented set is an LM ruler with b+1 marks and diameter D+2.

In any LM ruler, at most s-1 adjacent gaps can have length s, and no gap has length one. Minimizing their sum gives diameter at least B(b+1). Therefore

g+2b=D+2\ge B(b+1).

The two outside points are essential to this argument: their distances to the holes fall within the boundary counts in the pair formula.

3. The construction and its boundary requirement

To reach the bound, we build a sparse ruler of length B(b+1) and use its internal marks as holes. The smaller gaps follow a common ordered list, called the body. We use three arrangements of the body and the copies of the largest gap k. Only the case with one largest gap and odd k requires us to rotate the body.

Write k=2h+1+\eta, where \eta\in\{0,1\}, call h the height, and put H=h+1. To build the body W from [2], concatenate shorter lists called rows, in descending order a=h-1+\eta,\ldots,1. For odd k, start each row with a gap H. Within row a, append

(H+a,\ H+\eta-j,\ H+a,\ H+j),\qquad j=1,\ldots,a.

For even k, omit the fourth gap of the last block of each row. For odd k, append one final gap H after all rows, including when there are no rows. The body contains s-1 gaps of each length 2\le s<k.

Write k^t for t copies of the gap k. The full list of gaps (the gap word) is as follows:

  1. If r\ge2, use (k,W,k^{r-1}).
  2. If r=1 and k is even, use (W,k).
  3. If r=1 and k is odd, move the first gap of W to its end, then append k.

Starting at zero, add each gap in turn and let A be the set of positions visited. Let L=\max A=B(b+1), and let J=A\setminus\{0,L\}. Set

X=\{1,\ldots,L-1\}\setminus J,\qquad g=L-2b.

There are g+b marks in X, and its endpoints are 1 and L-1, since every gap is at least two. Its diameter is L-2=g+2b-2.

Count the holes within distance d of each outside endpoint, counting a hole twice if it is near both:

E(d)=\#\{j\in J:j\le d\}+\#\{j\in J:L-j\le d\}.

In terms of this boundary count, the pair formula from Section 2 becomes

r_X(d)=g+1-d+r_J(d)+E(d).

It therefore suffices to prove

r_J(d)+E(d)\le d-1. \tag{1}

We need only 1\le d\le\min(L-2,2b-1); for d\ge2b-1, the entire enclosing interval already has at most g pairs.

Bounding the counts of hole pairs and holes near the ends

Let F_k be the unmodified full AW ruler, with word (W,k^{k-1}), and let n_k=1+\binom{k}{2} be its number of marks.

For r\ge2, translating J by -k places its marks at the beginning of F_k. For even k with r=1, the holes already lie in F_k without translation. For odd k, r=1, write the positions reached by the successive body gaps as 0=p_0,p_1=H,\ldots,p_m=T. Translation by H gives

J+H=\{p_2,\ldots,p_m,T+H\}.

Thus there is at most one point outside F_k. One extra point creates at most two pairs of any fixed positive distance, so in all cases

r_J(d)\le r_{F_k}(d)+2. \tag{2}

Every two consecutive gaps in each modified word sum to at least k+1. The ordering of larger and smaller gaps in [2] gives this bound within the body. The only new adjacency within the rotated body is (H,H) in the odd case, with sum k+1. A boundary segment containing q holes therefore has length at least \lfloor q/2\rfloor(k+1). Applying this at both ends yields

E(d)\le\frac{4d}{k+1}+2\le\frac{2d}{H}+2.

Together,

r_J(d)+E(d)\le r_{F_k}(d)+\frac{4d}{k+1}+4. \tag{3}

We can now use one known pair count, that of the full ruler, to bound the hole and boundary counts for every number of largest gaps.

4. Short distances

At short distances a pair spans only one or two gaps. For heights h\ge2 we can therefore count pairs directly from the order of the gaps. Section 7 gives the direct check for height one.

For d\le k, no pair of consecutive gaps can sum to d. The gaps between consecutive holes are the prescribed gaps except for the first and last. In the formulas below, brackets equal one if the enclosed condition holds and zero otherwise. When r\ge2, those removed gaps are both k, and E(d)=2[d=k]. When r=1, the removed gaps are k-1,k, and E(d)=[d\ge k-1]+[d\ge k]. In either case (1) follows immediately from the inventory, including at d=k.

For k<d\le3h, the short-distance lemma in [2] counts pairs in the full ruler by counting runs of two successive gaps. With d=2H+t, the counts for odd k are

r_{F_k}(2H)=2h-2,\qquad r_{F_k}(2H+t)=2h-1-t\quad(t\ge1).

The count for even k is at most 2h. In the two cases where a translate of the holes lies entirely in the full ruler, E(d)=2, and these bounds prove (1).

In the rotated odd case, joining the last and first body gaps adds a two-gap run of length 2H. Removing the initial gap from the list of gaps between holes removes a run of length 3h. No new run of three gaps has sum at most 3h. Hence

r_J(d)=r_{F_k}(d)+[d=2H]-[d=3h],\qquad E(d)=2+[d=3h].

At d=2H, the sum is exactly 2h+1=d-1. At the remaining distances the odd formula again gives (1). At 3h, the lost run offsets the extra hole counted near the boundary. This is why the rotation works when there is one largest gap and k is odd.

5. Middle distances

For middle distances we use (3): we take the upper bound on the full ruler’s pair count from [2] and check how much room remains for the boundary terms. For h\ge151 and 3h<d<200h, [2] gives rational upper bounds for r_{F_k}(d)/h. Each pair spans a run of consecutive gaps. The proof groups runs by location: within a row, across adjacent rows, at the end of the word, or across multiple row boundaries. Every relevant run has at most 199 gaps. Williams bounds the counts separately for odd and even k, on 1,576 bands of the scaled distance u=d/h:

u=d/h\in[j/8,(j+1)/8],\qquad 24\le j\le1599,

and handles the lines d=2k,3k,4k separately for odd and even k.

Write M_j for a published band upper bound. To compare counts on the same scale, divide the extra terms in (3) by the height. Since H>h, they contribute at most

\frac{2u+4}{h}\le\frac{2(j+1)/8+4}{151}.

On band j, the allowed count (d-1)/h is at least j/8-1/151. Subtracting the published bound and the extra terms leaves a strictly positive margin even on the tightest band:

\min_{\text{both parities},j} \left(\frac j8-\frac1{151}-M_j-\frac{2(j+1)/8+4}{151}\right) =\frac{10}{453}>0. \tag{4}

The minimum occurs at j=48 for both parities. This establishes (1) off the three exceptional lines.

For a line d=sh+c, subtract (2(s+c/151)+4)/151 from the published line margin. All six remaining margins are positive; the smallest is 16447/68403, on the odd 2k line. The proof in [2] rules out intersections with other lines on which individual runs contribute extra pairs at h\ge151. Thus these cases also satisfy (1).

All 3,158 subtractions were evaluated as exact fractions. A separate implementation supplied with [2] regenerated the list of runs contributing to the bounds, checked the inputs against their digital fingerprints (hashes), and reproduced every band and exceptional-line upper bound. The grouping of runs in [2] makes these bounds apply at every height in this range.

6. Long distances

At long distances, we need only an upper bound on the number of pairs in the full ruler. We extend the four-progressions lemma of [2], which counts pairs using evenly spaced groups of marks, to twice its original distance range. For the full AW ruler the original lemma gives

r_{F_k}(d)\le\frac{2d}{3}+\frac{182H}{3},\qquad d<n_k. \tag{5}

The extended bound is

r_{F_k}(d)\le\frac{2d}{3}+\frac{278H}{3},\qquad d<2n_k. \tag{6}

To verify the change in constant, use the same partition of row marks into four arithmetic progressions (lists of equally spaced marks) with steps between 4H and 6H. Pairs involving marks outside these progressions contribute at most 6H; unequal-step pairs within a row contribute at most 8H; equal-step pairs within rows contribute at most 2d/3+44H/3. These parts do not use d<n_k.

For distinct rows a>c, there are at most 2H interacting ordered row pairs and sixteen choices of one progression from each row. These choices are called phase pairs. If q is the greatest common divisor of the two steps, [2] bounds the span of possible matches in units of the spacing between matching indices:

\frac{(c-1)q}{4H} \le\frac{3c}{4H}+\frac{d}{8H^2}.

For the original distance range the upper bound was less than one. Since c<H, n_k<2H^2, and now d<2n_k, it is less than 3/4+1/2<2. Thus each phase pair has at most two matches instead of one. The distinct-row contribution is at most 64H, replacing 32H. Adding the four contributions proves (6).

For 200h\le d<n_k, (3) and (5) prove (1) provided

d(H-6)\ge182H^2+15H.

At d=200(H-1), the left side minus the right side is 18H^2-1415H+1200>0 for H\ge152.

For n_k\le d<2n_k, use (6) instead. Since n_k\ge2H^2-3H+2, the corresponding difference is at least

(H-6)(2H^2-3H+2)-278H^2-15H =H^2(2H-293)+5H-12>0

for H\ge152. All remaining relevant distances are below 2b\le2(n_k-1). This completes the analytic argument at every height h\ge151.

7. Finite cases and independent checks

To cover heights below 151, we counted pairs using integer arithmetic. For each of the 300 full AW words at heights 1\le h\le150, we counted every pair difference through 2(n_k-1)-1. At each d>3h, we tested the integer inequality

(k+1)(d-1-r_{F_k}(d)-4)-4d\ge0.

This tests whether the upper bound in (3) is at most d-1. It settled all distances tested above height 26. For each unresolved distance we built the adjusted word for every permitted number of largest gaps and checked (1) exactly. We also checked short distances directly at height one. The enumeration used 1,553,762,943 additions to pair counts and 1,538 direct checks of a gap arrangement at a particular distance, with no failure. Together with Section 4, this covers every finite case.

An independent implementation counted pairs on the dense rulers themselves. It recorded each position as a bit indicating whether a mark was present. At distance d, the number of positions marked in both the original pattern and a copy shifted by d is exactly the pair count. Every relevant distance passed for every 2\le b\le1431. For heights 27 through 150, the independent implementation also reconstructed the full ruler's counts by summing consecutive gaps in batches. All 248 words satisfied the sufficient bound.

Table 1 includes additional checks on dense rulers at heights 151, 152 and 237. These covered both parities of k and r=1,2,k-1. For each ruler we checked all short distances, distances near the exceptional lines, endpoint distances and 100 random draws made with a fixed seed.

Check Coverage Result
Published middle-distance bounds after boundary adjustment 3,152 bands, both parities Smallest normalized margin: 10/453
Exceptional middle-distance lines Six lines Smallest normalized margin: 16447/68403
Finite full-word pair counts 300 words at heights 1–150; 1,553,762,943 pair increments Bound (3) suffices at every height 27–150
Direct boundary checks where needed 1,538 arrangement–distance cases, heights 1–26 All pass
Independent checks of (3) on full words 248 words, heights 27–150 All pass
Independent dense-complement counts 1,430 rulers, b = 2–1,431; 2,047,760 distances All pass
Larger dense-complement controls 18 rulers at heights 151, 152 and 237; 11,942 distances All sampled distances pass

Table 1. Verification coverage. A positive normalized margin means that the published difference-count bound, plus the new boundary contribution, remains below the allowed count after division by height. The last row is a sampled control, whereas the preceding dense-complement row checks every relevant distance.

Comparison of gap arrangements

For largest gaps k=3,\ldots,48 and every b=2,\ldots,1128, we compared 19,550 ways of splitting the largest gaps between the two ends of the unchanged body. These arrangements attained the bound for 1,105 of the 1,127 values of b. All 22 misses had one largest gap and odd k. Testing 16,742 arrangements with rotations of the body gave a solution for each of those 22 values. The arrangement counts include equivalent rulers.

8. Methods and scope

We used the public construction and proof supplements of [1,2], downloaded on 19 November 2026, and retained their source hashes. All arithmetic used to certify bounds was integer or rational. The finite enumeration, written in C++17, counted pairs by their starting and ending marks. The independent implementation, written in Python using the NumPy numerical library, rebuilt the gaps and summed runs of each possible number of consecutive gaps. Its checks on dense rulers used shifted bit patterns as described in Section 7.

The exact threshold rests on a computer-assisted proof. It relies on the proof in [2] that the groups of runs exhaust the possibilities. A single worst-case allowance for the boundary terms is unnecessarily restrictive: checking each distance band separately retains the height cutoff of 151. Exhaustive counts complete the proof below that cutoff. The proof has not been formally verified in a proof assistant. The optimal diameter immediately below the threshold remains an open question here.

References

[1] Ariel Williams. The sharp asymptotic diameter of linear-multiplicity rulers. Version 2, 19 November 2026. https://doi.org/10.5281/zenodo.24363243. Section “The threshold for high-multiplicity rulers.”

[2] Ariel Williams. Closing the Gaps with the AW Schedules: The Exact Minimum Diameter of Linear-Multiplicity Rulers. Version 1, 19 November 2026. https://doi.org/10.5281/zenodo.24362078. Gap schedules, short- and long-distance lemmas, middle-distance appendices, and public proof supplement (CC BY 4.0).

[3] Aditya Gupta and Kevin O'Bryant. Optimal Diameters of High Multiplicity g-Golomb Rulers. arXiv:2605.14229v2, 9 November 2026. https://arxiv.org/abs/2605.14229. Section 7, Problem 4.