We first construct a set F with 2k members, each member having at most k different scales in F. Take F={0,1,2,…,2k−1}. The scale between any two members of F is in the set {0,1,…,k−1}.
We now show that 2k is an upper bound on the size of F. For every finite set S of real numbers, and every real x, let rS(x) denote the number of different scales of x in S. That is, rS(x)=∣{D(x,y):x=y∈S}∣. Thus, for every element x of the set F in the problem statement, we have rF(x)⩽k. The condition ∣F∣⩽2k is an immediate consequence of the following lemma.
Lemma. Let S be a finite set of real numbers, and define
w(S)=x∈S∑2−rS(x)
Then w(S)⩽1.
Proof. Induction on n=∣S∣. If S={x}, then rS(x)=0, so w(S)=1.
Assume now n⩾2, and let x1<⋯<xn list the members of S. Let d be the minimal scale between two distinct elements of S; then there exist neighbours xt and xt+1 with D(xt,xt+1)=d. Notice that for any two indices i and j with j−i>1 we have D(xi,xj)>d, since
∣xi−xj∣=∣xi+1−xi∣+∣xj−xi+1∣⩾2d+2d=2d+1
Now choose the minimal i⩽t and the maximal j⩾t+1 such that D(xi,xi+1)=D(xi+1,xi+2)=⋯=D(xj−1,xj)=d.
Let E be the set of all the xs with even indices i⩽s⩽j, O be the set of those with odd indices i⩽s⩽j, and R be the rest of the elements (so that S is the disjoint union of E, O and R). Set SO=R∪O and SE=R∪E; we have ∣SO∣<∣S∣ and ∣SE∣<∣S∣, so w(SO),w(SE)⩽1 by the inductive hypothesis.
Clearly, rSO(x)⩽rS(x) and rSE(x)⩽rS(x) for any x∈R, and thus
x∈R∑2−rS(x)=21x∈R∑(2−rS(x)+2−rS(x))⩽21x∈R∑(2−rSO(x)+2−rSE(x))
On the other hand, for every x∈O, there is no y∈SO such that DSO(x,y)=d (as all candidates from S were in E). Hence, we have rSO(x)⩽rS(x)−1, and thus
x∈O∑2−rS(x)⩽21x∈O∑2−rSO(x)
Similarly, for every x∈E, we have
x∈E∑2−rS(x)⩽21x∈E∑2−rSE(x)
We can then combine these to give
w(S)=x∈R∑2−rS(x)+x∈O∑2−rS(x)+x∈E∑2−rS(x)⩽21x∈R∑(2−rSO(x)+2−rSE(x))+21x∈O∑2−rSO(x)+21x∈E∑2−rSE(x)=21(x∈SO∑2−rSO(x)+x∈SE∑2−rSE(x))(since SO=O∪R and SE=E∪R)=21(w(SO)+w(SE))(by definition of w(⋅))⩽1(by the inductive hypothesis)
which completes the induction.