TOPICS
Search

Maximum Distinct Differences


The maximum distinct differences problem asks for the largest number M(k,m) of distinct positive differences determined by a k-element subset of the integers 0, 1, ..., m, where m is a nonnegative integer and 1<=k<=m+1. Explicitly,

 M(k,m)=max_(A)|{a-b:a,b in A, a>b}|,
(1)

where the maximum is over the stated k-element subsets. Pikhurko and Schoen (2007, pp. 1-2) use D(k,m) for the largest cardinality of A-A, including zero and both signs, so D(k,m)=2M(k,m)+1. The number of unordered pairs and the available differences give

 M(k,m)<=min((k; 2),m).
(2)

Attaining the first bound requires all pairwise differences to be distinct, as in a Golomb ruler. Attaining the second requires every distance from 1 through m to occur. A sparse ruler minimizes the number of marks needed for that complete coverage, whereas this problem fixes the number of marks and maximizes the number of distances attained.

A sequence of particular interest takes m=(n; 2), where the two elementary bounds agree,

 a(n)=M(n,(n; 2))=(D(n,(n; 2))-1)/2.
(3)

Beginning with n=3, the recorded values are 3, 6, 9, 13, 19, 26, 32, 40, 49, 58, 68, 79, ... (OEIS A399997). This sequence was a runner-up in the OEIS 400K celebration contest (OEIS Foundation Inc. 2026).

MaximumDistinctDifferences

For n=9, the marks {0, 1, 3, 13, 20, 27, 31, 35, 36}attain 32 distances, missing only 6, 21, 25, and 29 (Pegg 2026). Adding a mark at 6 gives all 36 distances, illustrating the distinction between maximizing partial coverage and requiring complete coverage. Pegg (2026) also supplies larger constructions. For example, his 15-mark construction attains 90 distinct positive differences and therefore establishes a(15)>=90, with equality conjectural.

For any fixed c>=0, Pikhurko and Schoen (2007, pp. 3-4) proved that

 d(c)=lim_(m->infty)(D(k(m),m))/m
(4)

exists whenever k(m)=(c+o(1))sqrt(m), independently of the choice of the integer-valued function k(m). Here o(1) denotes a quantity tending to zero. Consequently, the special sequence satisfies

 lim_(n->infty)(a(n))/((n; 2))=(d(sqrt(2)))/2.
(5)

This limit concerns asymptotic density and does not establish exact finite values.


See also

Golomb Ruler, Sparse Ruler

Explore with Wolfram|Alpha

References

OEIS Foundation Inc. "A400K Winners." 2026. https://oeis.org/wiki/A400K_Winners. Pegg, E. Jr. "Winners of the OEIS 400K Milestone Contest." Wolfram Community. Oct. 26, 2026. https://community.wolfram.com/t/28423.Pikhurko, O. and Schoen, T. "Integer Sets Having the Maximum Number of Distinct Differences." Integers 7, A11, 1-9, 2007. https://doi.org/10.5281/zenodo.8278484.Sloane, N. J. A. Sequence A399997 in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Maximum Distinct Differences." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/MaximumDistinctDifferences.html

Subject classifications