betaFeedback

WorksMathematics

Denominators in the Farey Sequence, the Stern Sequence, and the Frobenius Problem with Relatively Prime Multipliers

Abstract

The Frobenius problem asks, given two positive, relatively prime integers aa and bb, what is the maximum integer that cannot be expressed as a linear combination of a,ba,b using non-negative coefficients? This problem is resolved. However, if we add the restriction that the coefficients themselves must also be relatively prime, we create an open problem with connections to the Stern and Farey sequences and the Jacobsthal function. We prove that under this new restriction, a maximum inexpressible integer still always exists, and explore its values and properties as functions of a,ba,b.

Introduction

In 1850, Eisenstein wrote to Stern concerning which denominators appear between ta\frac{t}{a}, sb\frac{s}{b} consecutive in some Farey sequence, and how often [1]. This inspired Stern to devise his diatomic array. In this paper, we use this and techniques of analytic number theory to show that if gcd⁡(a,b)=1\gcd(a,b)=1, then there is a computable function g(a,b)g(a,b), so that if n>g(a,b)n>g(a,b), then a fraction mn\frac{m}{n} eventually appears between ta\frac{t}{a} and sb\frac{s}{b}. This translates into a variation on the Frobenius problem: suppose aa and bb are positive, relatively prime integers. If n>g(a,b)n>g(a,b), then there exist positive, relatively prime integers xx and yy so that n=ax+byn=ax+by.

Recall that the Farey sequence of order nn, denoted FnF_n, is defined as “the ascending series of irreducible fractions between 0 and 1 whose denominators do not exceed nn” [2]. The Farey sequences have a rich structure, including the fact that if ta,sb\frac{t}{a},\frac{s}{b} are consecutive terms in a Farey sequence of any order, then as−bt=1as-bt=1. Furthermore, the first term to appear between these terms will be t+sa+b\frac{t+s}{a+b}, in the Farey sequence of order a+ba+b.

The diatomic array is defined as having first row a,ba,b and each subsequent row a repetition of the previous row with the sum of consecutive terms inserted between them, as shown in Figure 1. We will borrow the notation of [3] in denoting the entire diatomic array with first row a,ba,b by Z(a,b)Z(a,b). It is convenient to classify the general recurrence in terms of rows and positions within the diatomic array: let a term Z(r,k;a,b)Z(r,k;a,b) occur in the kthk^{\text{th}} position from the left in the rthr^{\text{th}} row down of the diatomic array Z(a,b)Z(a,b), where the counts for both kk and rr start at 0 [3]. Under this system, the first row (consisting of an aa and a bb and no other entries) is row 0, and has an aa in position 0 and a bb in position 1. Rewriting the recurrence in this language, we see that each entry in an even position, say position 2k2k, is equal to the entry in position kk in the row immediately above, and each entry in an odd position, say position 2k+12k+1, is equal to the sum of the entries in positions kk and k+1k+1 in the row immediately above.

Rows 0–3 of the diatomic array $Z(a,b)$

Figure 1. Rows 0–3 of the diatomic array Z(a,b)Z(a,b).

We define the Stern sequence by

s(0)=0,s(1)=1;s(2n)=s(n),s(2n+1)=s(n)+s(n+1) for n≥1.s(0)=0,\quad s(1)=1;\qquad s(2n)=s(n),\quad s(2n+1)=s(n)+s(n+1)\text{ for }n\geq1.

The Stern sequence satisfies a number of interesting properties that relate to the diatomic array [4], including:

  • If 0≤k≤2r0\leq k\leq2^r, then Z(r,k;0,1)=s(n)Z(r,k;0,1)=s(n).

  • Z(r,k;a,b)=s(2r−k)a+s(k)bZ(r,k;a,b)=s(2^r-k)a+s(k)b.

  • s(2rn+k)=s(2r−k)s(n)+s(k)s(n+1)s(2^r n+k)=s(2^r-k)s(n)+s(k)s(n+1) for 0≤k≤2r0\leq k\leq2^r.

  • s(2r)=1s(2^r)=1 and s(2r−1)=rs(2^r-1)=r.

Eisenstein wrote Stern that he had a proof that every denominator between ta,sb\frac{t}{a},\frac{s}{b} in some Farey sequence must appear in the diatomic array Z(a,b)Z(a,b) [1].

It is not difficult to show that s:Z≥0→Z≥0s:\mathbb{Z}_{\geq0}\to\mathbb{Z}_{\geq0} is surjective. In particular, we emphasize the point that every positive integer appears at least once somewhere within the diatomic array Z(0,1)Z(0,1). This will not hold if we use the same recurrence relation but with a different choice of initial conditions, i.e. a different choice of a,ba,b. One trivial way this condition can fail is if gcd⁡(a,b)>1\gcd(a,b)>1. It follows from the above that Z(r,k;a,b)Z(r,k;a,b) must be divisible by gcd⁡(a,b)\gcd(a,b) for all r,kr,k. Then any natural number not divisible by gcd⁡(a,b)\gcd(a,b) cannot be expressed as Z(r,k;a,b)Z(r,k;a,b) and equivalently does not appear in Z(a,b)Z(a,b). However, adding in the condition that gcd⁡(a,b)=1\gcd(a,b)=1 is not sufficient to conclude that every positive integer will appear in Z(a,b)Z(a,b). Suppose, for example, that we choose a=5,b=7a=5,b=7. Then gcd⁡(a,b)=1\gcd(a,b)=1, but we still cannot express every natural number as Z(r,k;5,7)Z(r,k;5,7) for some r,kr,k. A cursory examination of Z(5,7)Z(5,7) makes clear that each “new” entry past row 0 must be at least 12:

575127517121975221729123119267⋯\begin{aligned} 5 &&&&&&&& 7\\ 5 && 12 &&&&&& 7\\ 5 && 17 && 12 && 19 && 7\\ 5 && 22 && 17 && 29 && 12 && 31 && 19 && 26 && 7\\ &&&& \cdots \end{aligned}

Then 1,2,3,4,6,8,9,10,11∉Z(5,7)1,2,3,4,6,8,9,10,11 \notin\mathbb{Z}(5,7). Our chief goals here are to explore, for a general a,b∈Z+a,b \in\mathbb{Z}^{+}, which non-negative integers can be expressed as Z(r,k;a,b)Z(r,k;a,b) for some r,kr,k, which cannot, and why. This work is drawn from my thesis, Topics in Analytic Number Theory. In later sections, we will define g(a,b)g(a,b) as the largest integer that cannot be expressed as Z(r,k;a,b)Z(r,k;a,b) and show not only that g(a,b)g(a,b) always exists but also give an upper bound of N(a,b)=p1p2⋯prN(a,b)=p_{1}p_{2}\cdots p_{r} for the minimum rr satisfying 2ab<p3−12⋅p4−12⋯pr−122ab < \frac{p_{3}-1}{2}\cdot\frac{p_{4}-1}{2}\cdots\frac{p_{r-1}}{2} where pip_i is the iith prime (see Theorem 4.3). We will note g(a,b)g(a,b) is bounded below by f(a,b)f(a,b), the Frobenius number of aa and bb, in Section 3. We will focus on building better upper bounds in Theorem 6.5 and Corollary 6.6, and study patterns in the values of g(a,b)g(a,b) in Sections 5 and 7. First, we return our attention to the diatomic array at large.

Definitions and Preliminary Results

For any choice of a,ba,b, we set

S(a,b)={n∈Z≥0:∃r,k∈Z≥0 s.t. n=Z(r,k;a,b) and k≤2r}.S_{(a,b)}=\{n\in\mathbb{Z}_{\geq0}:\exists r,k\in\mathbb{Z}_{\geq0}\text{ s.t. }n=Z(r,k;a,b)\text{ and }k\leq2^r\}.

Then S(a,b)S_{(a,b)} is the set of exactly those non-negative integers appearing in the diatomic array Z(a,b)Z(a,b).

For gcd⁡(a,b)=d>1\gcd(a,b)=d>1, if d∣nd\mid n, we can verify

n∈S(a,b)⟺nd∈S(ad,bd)⟺n∈dS(ad,bd).n\in S_{(a,b)}\Longleftrightarrow\frac{n}{d}\in S_{\left(\frac{a}{d},\frac{b}{d}\right)}\Longleftrightarrow n\in dS_{\left(\frac{a}{d},\frac{b}{d}\right)}.

If d∤nd\nmid n, then nd∉Z≥0\frac{n}{d}\notin\mathbb{Z}_{\geq0} and so nd∉S(ad,bd)\frac{n}{d}\notin S_{\left(\frac{a}{d},\frac{b}{d}\right)}; it follows from the above that n∉S(a,b)n\notin S_{(a,b)}. Then S(a,b)=dS(ad,bd)S_{(a,b)}=dS_{\left(\frac{a}{d},\frac{b}{d}\right)}, which justifies restricting our consideration to cases where gcd⁡(a,b)=1\gcd(a,b)=1.

We note that Z(r,2r−k;a,b)=Z(r,k;b,a)Z(r,2^r-k;a,b)=Z(r,k;b,a) [4], and it follows that S(a,b)=S(b,a)S_{(a,b)}=S_{(b,a)}, so we may treat the two interchangeably.

Theorem 2.1. There exist x,y∈Z≥0x,y\in\mathbb{Z}_{\geq0} such that n=ax+byn=ax+by and gcd⁡(x,y)=1\gcd(x,y)=1 if and only if n∈S(a,b)n\in S_{(a,b)}.

We make several smaller claims before proceeding to the proof of Theorem 2.1.

Proposition 2.2. Let r≥1r \ge1, 0≤k≤2r0 \le k \le2^r, and a<ba < b. Then each new element in Z(a,b)Z(a,b) (i.e. every element in an odd position) is at least ra+bra+b.

This can be proven by inducting on rr, and less formally, follows intuitively from Figure 1. It follows as a result that every odd element in row (m+1)(m+1) of Z(a,b)Z(a,b) is greater than at least one odd element in row mm of Z(a,b)Z(a,b).

Proposition 2.3. If a<ba < b, n<ra+bn < ra+b, and nn does not appear in the first rr rows of Z(a,b)Z(a,b), then n∉Z(a,b)n \notin Z(a,b).

This time, the proof considers the (r+t)th(r+t)^{th} row of Z(a,b)Z(a,b) for t≥1t \ge1 and proceeds by induction on tt.

Theorem 2.4. Let r≥0r \ge0 and 0≤k≤2r0 \le k \le2^r. Then gcd⁡(s(k),s(2r−k))=1\gcd(s(k),s(2^r-k))=1.

Proof. We proceed by induction on rr. Given that {s(0),s(1),s(2),s(3),s(4)}={0,1,1,2,1}\{s(0),s(1),s(2),s(3),s(4)\}=\{0,1,1,2,1\}, it is easy to verify that the claim holds for r=0,1,2r=0,1,2. Suppose now that the claim holds for some r≥2r \ge2 and consider gcd⁡(s(k),s(2r+1−k))\gcd(s(k),s(2^{r+1}-k)) for 0≤k≤2r+10 \le k \le2^{r+1}. It suffices to consider 0≤k≤2r0 \le k \le2^r, for if k≥2rk \ge2^r, then by letting l=2r+1−kl=2^{r+1}-k, we have

gcd⁡(s(k),s(2r+1−k))=gcd⁡(s(2r+1−l),s(l))=gcd⁡(s(l),s(2r+1−l))\gcd(s(k),s(2^{r+1}-k))=\gcd(s(2^{r+1}-l),s(l))=\gcd(s(l),s(2^{r+1}-l))

where 0≤l≤2r0 \le l \le2^r. Then we may assume without loss of generality that 0≤k≤2r0 \le k \le2^r, and consequently may put k=2r−mk=2^r-m for 0≤m≤2r0 \le m \le2^r. Then

gcd⁡(s(k),s(2r+1−k))=gcd⁡(s(2r−m),s(2r+1−2r+m))=gcd⁡(s(2r−m),s(2r+m)).\gcd(s(k),s(2^{r+1}-k))=\gcd(s(2^r-m),s(2^{r+1}-2^r+m))=\gcd(s(2^r-m),s(2^r+m)).

By recalling s(2rn+k)=s(2r−k)s(n)+s(k)s(n+1)s(2^r n+k)=s(2^r-k)s(n)+s(k)s(n+1) for 0≤k≤2r0 \le k \le2^r [4] and setting n=1n=1, k=mk=m, we obtain

s(2r+m)=s(2r⋅1+m)=s(2r−m)s(1)+s(m)s(2)=s(2r−m)+s(m).s(2^r+m)=s(2^r\cdot1+m)=s(2^r-m)s(1)+s(m)s(2)=s(2^r-m)+s(m).

Then

gcd⁡(s(k),s(2r+1−k))=gcd⁡(s(2r−m),s(2r+m))=gcd⁡(s(2r−m),s(2r−m)+s(m))=gcd⁡(s(2r−m),s(m))=1,\begin{aligned} \gcd(s(k),s(2^{r+1}-k))&=\gcd(s(2^r-m),s(2^r+m))\\ &=\gcd(s(2^r-m),s(2^r-m)+s(m))\\ &=\gcd(s(2^r-m),s(m))\\ &=1, \end{aligned}

where the last step follows by the induction hypothesis.

Corollary 2.5. Let r≥0r \ge0 and 0≤k≤2r0 \le k \le2^r. Then gcd⁡(s(k),s(2r+k))=1\gcd(s(k),s(2^r+k))=1.

Proof. Since we have seen that s(2r+k)=s(2r−k)+s(k)s(2^{r}+k)=s(2^{r}-k)+s(k) in the proof of Theorem 2.4, it follows that

gcd⁡(s(k),s(2r+k))=gcd⁡(s(k),s(2r−k)+s(k))=gcd⁡(s(k),s(2r−k))=1\gcd(s(k),s(2^{r}+k))=\gcd(s(k),s(2^{r}-k)+s(k))=\gcd(s(k),s(2^{r}-k))=1

where the last equality follows directly from Theorem 2.4.

Remark 2.6. Let a,b∈Z≥0a,b\in\mathbb{Z}_{\geq0} with gcd⁡(a,b)=1\gcd(a,b)=1. Then there exists a unique odd kk and rr such that a=s(k)a=s(k) and b=s(2r+k)b=s(2^{r}+k).

This follows immediately from the fact that “we can...regard the Stern-Brocot tree as a number system for representing rational numbers, because each positive, reduced fraction occurs exactly once” [5 pg. 119].

We now have all the ingredients needed to prove our earlier claim.

Proof of Theorem 2.1. (⟸)(\Longleftarrow) Let n∈S(a,b)n\in S_{(a,b)}. Then there exists some r≥0r\geq0, 0≤k≤2r0\leq k\leq2^{r} such that

n=Z(r,k;a,b)=s(2r−k)a+s(k)b.n=Z(r,k;a,b)=s(2^{r}-k)a+s(k)b.

By Theorem 2.4, gcd⁡(s(k),s(2r−k))=1\gcd(s(k),s(2^{r}-k))=1, so we may take x=s(k)x=s(k) and y=s(2r−k)y=s(2^{r}-k), which guarantees x,y∈Z≥0x,y\in\mathbb{Z}_{\geq0}, gcd⁡(x,y)=1\gcd(x,y)=1, and n=ax+byn=ax+by.

(⟹)(\Longrightarrow) Let there exist x,y∈Z≥0x,y\in\mathbb{Z}_{\geq0} such that n=ax+byn=ax+by and gcd⁡(x,y)=1\gcd(x,y)=1. Because gcd⁡(x,y)=1\gcd(x,y)=1, we also know gcd⁡(y,x+y)=1\gcd(y,x+y)=1, and so there exists a unique odd kk and rr such that y=s(k)y=s(k) and x+y=s(2r+k)x+y=s(2^{r}+k) by Remark 2.6. As we have seen above, s(2r+k)=s(2r−k)+s(k)s(2^{r}+k)=s(2^{r}-k)+s(k), and since y=s(k)y=s(k),

x+y=s(2r+k)=s(2r−k)+s(k)⟹x=s(2r−k).x+y=s(2^{r}+k)=s(2^{r}-k)+s(k)\Longrightarrow x=s(2^{r}-k).

Then n=ax+by=s(2r−k)a+s(k)bn=ax+by=s(2^{r}-k)a+s(k)b which implies n∈S(a,b)n\in S(a,b).

Interpreted through the lens of Theorem 2.1, the problem begins to bear a strong resemblance to the Frobenius problem.

The Frobenius Connection

For a finite set of positive integers {a1,a2,…,an}\{a_1,a_2,\ldots,a_n\} such that gcd⁡(a1,a2,…,an)=1\gcd(a_1,a_2,\ldots,a_n)=1, the Frobenius number f(a1,a2,…,an)f(a_1,a_2,\ldots,a_n) is the largest integer that cannot be expressed as a sum of the form k1a1+k2a2+…+knank_1a_1+k_2a_2+\ldots+k_na_n for non-negative integers k1,k2,…,knk_1,k_2,\ldots,k_n [6]. The Frobenius problem is to find the Frobenius number given information about the set {a1,a2,…,an}\{a_1,a_2,\ldots,a_n\}. We note that f(a,b)=ab−a−bf(a,b)=ab-a-b was proven by James Joseph Sylvester in 1882 [6].

For positive integers a,ba,b such that gcd⁡(a,b)=1\gcd(a,b)=1, we define g(a,b)g(a,b) to be the largest integer that cannot be expressed as ax+byax+by for relatively prime, non-negative integers x,yx,y; if no such integer exists, we will say g(a,b)=∞g(a,b)=\infty. This is essentially a variation of the Frobenius problem in which weไทยฟรี set n=2n=2 and place restrictions on the coefficients k1,k2k_1,k_2 in addition to those on the set elements a1,a2a_1,a_2. Note that by the previous section, g(a,b)g(a,b) is equivalently defined as sup⁡(Z∖S(a,b))\sup(\mathbb{Z}\setminus S_{(a,b)}).

Certainly g(a,b)≥f(a,b)g(a,b)\ge f(a,b), as there cannot be a relatively prime integral solution to ax+by=Nax+by=N unless there is already an integral solution. However, the existence of an integral solution, or of several integral solutions, is not sufficient; consider again our example in which a=5,b=7a=5,b=7. By Section 1, we already know g(5,7)≥11g(5,7)\ge11, and invoking the Frobenius problem, we can further conclude g(5,7)≥f(5,7)=5⋅7−5−7=23g(5,7)\ge f(5,7)=5\cdot7-5-7=23. We now use the FrobeniusSolve function in Mathematica to generate all non-negative integral solutions to 5x+7y=1565x+7y=156 in Figure 2. Although we have four possible solutions, none of them satisfy the condition that gcd⁡(x,y)=1\gcd(x,y)=1. Our choice of 156156 was not accidental; in the next sections, we will develop the tools necessary to show g(5,7)=156g(5,7)=156, and thus that for every integer N>156N>156, we can guarantee the existence of a relatively prime integral solution to 5x+7y=N5x+7y=N. For now, we return our attention to a general choice of a,ba,b and begin to build the results necessary to prove that g(a,b)g(a,b) always exists (that is, it is always finite).

Mathematica output showing all non-negative integral solutions to $5x+7y=156$

Figure 2. All non-negative integral solutions (x,y)(x,y) to 5x+7y=1565x+7y=156 have gcd⁡(x,y)>1\gcd(x,y)>1.

The Existence of g(a,b)g(a,b)

So far, we have been able to offer an alternate definition and a lower bound for g(a,b)g(a,b). We now prove that g(a,b)<∞g(a,b)<\infty for any choice of relatively prime a,ba,b using techniques from analytic number theory.

Lemma 4.1. For any choice of positive integers a,ba,b, there exists a positive integer r0r_0 such that if r≥r0r\ge r_0, then ab⋅2r<(p1−1)(p2−1)⋯(pr−1)ab\cdot2^r<(p_1-1)(p_2-1)\cdots(p_r-1), where pip_i represents the ithi^{\text{th}} prime.

Proof. Note that

ab⋅2r<(p1−1)(p2−1)⋯(pr−1)ab\cdot2^r<(p_1-1)(p_2-1)\cdots(p_r-1)
⟺ab<p1−12⋅p2−12⋅p3−12⋯pr−12\Longleftrightarrow ab<\frac{p_1-1}{2}\cdot\frac{p_2-1}{2}\cdot\frac{p_3-1}{2}\cdots\frac{p_r-1}{2}
⟺ab<2−12⋅3−12⋅p3−12⋯pr−12\Longleftrightarrow ab<\frac{2-1}{2}\cdot\frac{3-1}{2}\cdot\frac{p_3-1}{2}\cdots\frac{p_r-1}{2}
⟺2ab<p3−12⋅p4−12⋯pr−12.\Longleftrightarrow2ab<\frac{p_3-1}{2}\cdot\frac{p_4-1}{2}\cdots\frac{p_r-1}{2}.

Because a,ba,b are fixed, we know 2ab2ab is fixed, whereas the right-hand side of the last inequality grows without bound. Then there is certainly a minimum r0r_0 such that 2ab<p3−12⋅p4−12⋯pr0−122ab < \frac{p_3-1}{2}\cdot\frac{p_4-1}{2}\cdots\frac{p_{r_0}-1}{2}, and for all r≥r0r \ge r_0, we have

2ab<p3−12⋅p4−12⋯pr0−12≤p3−12⋅p4−12⋯pr0−12⋯pr−12.2ab < \frac{p_3-1}{2}\cdot\frac{p_4-1}{2}\cdots\frac{p_{r_0}-1}{2} \le\frac{p_3-1}{2}\cdot\frac{p_4-1}{2}\cdots\frac{p_{r_0}-1}{2}\cdots\frac{p_r-1}{2}.

By the above, we may conclude ab⋅2r<(p1−1)(p2−1)⋯(pr−1)ab\cdot2^r < (p_1-1)(p_2-1)\cdots(p_r-1) for all r≥r0r \ge r_0.

Lemma 4.2. Let ϕ(n)\phi(n) be Euler’s phi function and ω(n)\omega(n) be the number of distinct primes dividing nn. Then for any choice of positive integers a,ba,b and all sufficiently large nn, we have ab⋅2ω(n)<ϕ(n)ab\cdot2^{\omega(n)} < \phi(n).

Proof. Because a,ba,b are positive integers, it follows by Lemma 4.1 that there exists r0∈Z+r_0 \in\mathbb{Z}^{+} such that if r≥r0r \ge r_0, then ab⋅2r<(p1−1)(p2−1)⋯(pr−1)ab\cdot2^r < (p_1-1)(p_2-1)\cdots(p_r-1). We set N=p1p2⋯pr0N=p_1p_2\cdots p_{r_0} and note by computing ϕ(N)\phi(N) and ω(N)\omega(N) directly that ab⋅2r0<(p1−1)(p2−1)⋯(pr0−1)ab\cdot2^{r_0} < (p_1-1)(p_2-1)\cdots(p_{r_0}-1) if and only if ab⋅2ω(N)<ϕ(N)ab\cdot2^{\omega(N)} < \phi(N).

Let m>Nm>N. We divide into two cases.

Case 1: ω(m)>ω(N)\omega(m)>\omega(N). We set m=q1l1q2l2⋯qklkm=q_1^{l_1}q_2^{l_2}\cdots q_k^{l_k}, with q1<q2<⋯<qkq_1<q_2<\cdots<q_k all prime and each lil_i a positive integer. Since k:=ω(m)>ω(N)=r0k:=\omega(m)>\omega(N)=r_0, it follows from Lemma 4.1 that ab⋅2k<(p1−1)(p2−1)⋯(pk−1)ab\cdot2^k < (p_1-1)(p_2-1)\cdots(p_k-1). We also observe qi≥piq_i\ge p_i for i≤ki\le k to obtain the following:

ϕ(m)=ϕ(q1l1q2l2⋯qklk)=∏i=1kϕ(qili)=∏i=1kqili−1(qi−1)≥∏i=1kqi0(qi−1)=∏i=1k(qi−1)≥∏i=1k(pi−1)>ab⋅2k.\begin{aligned} \phi(m)=\phi\left(q_1^{l_1}q_2^{l_2}\cdots q_k^{l_k}\right)=\prod_{i=1}^{k}\phi\left(q_i^{l_i}\right)=\prod_{i=1}^{k}q_i^{l_i-1}(q_i-1)\ge\prod_{i=1}^{k}q_i^0(q_i-1) \\ &=\prod_{i=1}^{k}(q_i-1)\ge\prod_{i=1}^{k}(p_i-1)>ab\cdot2^k. \end{aligned}

Hence ab⋅2ω(m)<ϕ(m)ab\cdot2^{\omega(m)}<\phi(m).

Case 2: ω(m)≤ω(N)\omega(m)\le\omega(N). Again set m=q1l1q2l2⋯qklkm=q_1^{l_1}q_2^{l_2}\cdots q_k^{l_k}, with q1<q2<⋯<qkq_1<q_2<\cdots<q_k all prime and each lil_i a positive integer. It is still true that qi≥piq_i\ge p_i for i≤ki\le k, and qi≥piq_i\ge p_i implies that 1−1qi≥1−1pi1-\frac{1}{q_i}\ge1-\frac{1}{p_i}. We also know that 1−1pj≤11-\frac{1}{p_j}\le1 for j≤r0j\le r_0, and together with an alternate formula for ϕ\phi, we see

ϕ(m)=m∏i=1k(1−1qi)≥m∏i=1k(1−1pi)≥m∏i=1r0(1−1pi)>N∏i=1r0(1−1pi)=ϕ(N).\phi(m)=m\prod_{i=1}^{k}\left(1-\frac{1}{q_i}\right)\ge m\prod_{i=1}^{k}\left(1-\frac{1}{p_i}\right)\ge m\prod_{i=1}^{r_0}\left(1-\frac{1}{p_i}\right)>N\prod_{i=1}^{r_0}\left(1-\frac{1}{p_i}\right)=\phi(N).

Since ω(m)≤ω(N)\omega(m)\le\omega(N) and we have already seen above that ab⋅2ω(N)<ϕ(N)ab\cdot2^{\omega(N)}<\phi(N), it follows that

ab⋅2ω(m)≤ab⋅2ω(N)<ϕ(N)<ϕ(m).ab\cdot2^{\omega(m)}\le ab\cdot2^{\omega(N)}<\phi(N)<\phi(m).

This completes the second case, and so we may conclude that for all m≥Nm\ge N, we have ab⋅2ω(m)<ϕ(m)ab\cdot2^{\omega(m)}<\phi(m).

Theorem 4.3. For a,b>0a,b>0 with gcd⁡(a,b)=1\gcd(a,b)=1, we have g(a,b)<∞g(a,b)<\infty.

Proof. Let a,b∈Z≥0a,b \in\mathbb{Z}_{\ge0} with gcd⁡(a,b)=1\gcd(a,b)=1 be fixed. We show that for sufficiently large nn,

∣{(x,y)∈Z≥0×Z≥0:ax+by=n&gcd⁡(x,y)=1}∣≥1;\left|\{(x,y) \in\mathbb{Z}_{\ge0} \times\mathbb{Z}_{\ge0} : ax+by=n \mathbin{\&} \gcd(x,y)=1\}\right| \ge1;

in particular, the set is non-empty.

For μ(d)\mu(d) the Möbius function, recall ∑d∣nμ(d)=1\sum_{d\mid n}\mu(d)=1 for n=1n=1 and 00 otherwise. Then we may count ∣{(x,y)∈Z≥0×Z≥0:ax+by=n&gcd⁡(x,y)=1}∣\left|\{(x,y) \in\mathbb{Z}_{\ge0} \times\mathbb{Z}_{\ge0} : ax+by=n \mathbin{\&} \gcd(x,y)=1\}\right| as

∑x,y≥0ax+by=n∑d∣gcd⁡(x,y)μ(d)=∑x,y≥0ax+by=n∑d∣x,d∣yμ(d)=∑d≥1∑x,y≥0ax+by=nd∣x,d∣yμ(d)=∑d≥1μ(d)∑x,y≥0ax+by=nd∣x,d∣y1.\begin{aligned} &\sum_{\substack{x,y\ge0\\ ax+by=n}}\sum_{d\mid\gcd(x,y)}\mu(d)\\ ={}&\sum_{\substack{x,y\ge0\\ ax+by=n}}\sum_{\substack{d\mid x,d\mid y}}\mu(d)\\ ={}&\sum_{d\ge1}\sum_{\substack{x,y\ge0\\ ax+by=n\\d\mid x,d\mid y}}\mu(d)\\ ={}&\sum_{d\ge1}\mu(d)\sum_{\substack{x,y\ge0\\ ax+by=n\\d\mid x,d\mid y}}1. \end{aligned}

Upon setting x=du,y=dvx=du,y=dv for u,v∈Z≥0u,v \in\mathbb{Z}_{\ge0}, we obtain

∑d≥1μ(d)∑x,y≥0ax+by=nd∣x,d∣y1=∑d≥1μ(d)∑du,dv≥0adu+bdv=n1=∑d≥1μ(d)∣{(u,v)∈Z≥0×Z≥0:adu+bdv=n}∣=∑d∣nμ(d)∣{(u,v)∈Z≥0×Z≥0:au+bv=nd}∣.\begin{aligned} \sum_{d\ge1}\mu(d)\sum_{\substack{x,y\ge0\\ ax+by=n\\d\mid x,d\mid y}}1 &=\sum_{d\ge1}\mu(d)\sum_{\substack{du,dv\ge0\\adu+bdv=n}}1\\ &=\sum_{d\ge1}\mu(d)\left|\{(u,v)\in\mathbb{Z}_{\ge0}\times\mathbb{Z}_{\ge0}:adu+bdv=n\}\right|\\ &=\sum_{d\mid n}\mu(d)\left|\{(u,v)\in\mathbb{Z}_{\ge0}\times\mathbb{Z}_{\ge0}:au+bv=\frac{n}{d}\}\right|. \end{aligned}

We now turn our attention to ∣{(u,v)∈Z≥0×Z≥0:au+bv=nd}∣\left|\{(u,v)\in\mathbb{Z}_{\ge0}\times\mathbb{Z}_{\ge0}:au+bv=\frac{n}{d}\}\right|. Because we know that gcd⁡(a,b)=1\gcd(a,b)=1 and 1∣nd1\mid\frac{n}{d} for all divisors dd of nn, it follows that there always exists some solution to au0+bv0=ndau_0+bv_0=\frac{n}{d} for integers u0,v0u_0,v_0 (not necessarily non-negative). All other integer solutions must be of the form u=u0+kb,v=v0−kau=u_0+kb,v=v_0-ka for some k∈Zk\in\mathbb{Z}. Since we want to count only those solutions for which u,v≥0u,v\ge0, we count only those integers kk for which u0+kb≥0u_0+kb\ge0 and v0−ka≥0v_0-ka\ge0. Solving each for kk, we obtain −u0b≤k-\frac{u_0}{b}\le k and k≤v0ak\le\frac{v_0}{a}. The number of integers kk satisfying both inequalities is then

⌊v0a⌋−⌊−u0b⌋+1=⌊v0a⌋+⌊u0b⌋+1=v0a−{v0a}+u0b−{u0b}+1=au0+bv0ab−{u0b}−{v0a}+1=ndab−{u0b}−{v0a}+1.\left\lfloor\frac{v_0}{a} \right\rfloor-\left\lfloor\frac{-u_0}{b} \right\rfloor+1=\left\lfloor\frac{v_0}{a} \right\rfloor+\left\lfloor\frac{u_0}{b} \right\rfloor+1 =\frac{v_0}{a}-\left\{\frac{v_0}{a}\right\}+\frac{u_0}{b}-\left\{\frac{u_0}{b}\right\}+1 =\frac{au_0+bv_0}{ab}-\left\{\frac{u_0}{b}\right\}-\left\{\frac{v_0}{a}\right\}+1 =\frac{n}{dab}-\left\{\frac{u_0}{b}\right\}-\left\{\frac{v_0}{a}\right\}+1.

By definition, {x}\{x\}, the fractional part of any number xx, always satisfies {x}∈[0,1)\{x\}\in[0,1), so

1−{u0b}−{v0a}≤1−0−0=11-\left\{\frac{u_0}{b}\right\}-\left\{\frac{v_0}{a}\right\}\le1-0-0=1

and

1−{u0b}−{v0a}>1−1−1=−1.1-\left\{\frac{u_0}{b}\right\}-\left\{\frac{v_0}{a}\right\}>1-1-1=-1.

It follows that

∣{(u,v)∈Z≥0×Z≥0:au+bv=nd}∣=ndab+E(nd)\left|\left\{(u,v)\in\mathbb{Z}_{\ge0}\times\mathbb{Z}_{\ge0}:au+bv=\frac{n}{d}\right\}\right|=\frac{n}{dab}+E\left(\frac{n}{d}\right)

where E(nd)E\left(\frac{n}{d}\right) represents an error as a function of n,dn,d and ∣E(nd)∣≤1\left|E\left(\frac{n}{d}\right)\right|\le1 for all n,dn,d. We are justified in treating the error as a function of nd\frac{n}{d} because a,ba,b are fixed, and u0,v0u_0,v_0 depend on a,b,nda,b,\frac{n}{d}. With this result, we may write

∑d∣nμ(d)∣{(u,v)∈Z≥0×Z≥0:au+bv=nd}∣=∑d∣nμ(d)(ndab+E(nd))=∑d∣nμ(d)ndab+∑d∣nμ(d)E(nd).\begin{aligned} \sum_{d\mid n}\mu(d)\left|\left\{(u,v)\in\mathbb{Z}_{\ge0}\times\mathbb{Z}_{\ge0}:au+bv=\frac{n}{d}\right\}\right| \\ &=\sum_{d\mid n}\mu(d)\left(\frac{n}{dab}+E\left(\frac{n}{d}\right)\right) \\ &=\sum_{d\mid n}\mu(d)\frac{n}{dab}+\sum_{d\mid n}\mu(d)E\left(\frac{n}{d}\right). \end{aligned}

The first sum simplifies nicely using an analytic number theory identity, given as Theorem 2.3 in [7 pg. 26-27]:

∑d∣nμ(d)ndab=1ab(∑d∣nμ(d)nd)=1ab(ϕ(n))=ϕ(n)ab.\sum_{d\mid n}\mu(d)\frac{n}{dab}=\frac{1}{ab}\left(\sum_{d\mid n}\mu(d)\frac{n}{d}\right)=\frac{1}{ab}\left(\phi(n)\right)=\frac{\phi(n)}{ab}.

Using the fact that ∣E(nd)∣≤1\left|E\left(\frac{n}{d}\right)\right|\le1, we can bound the second sum:

∑d∣nμ(d)E(nd)≤∣∑d∣nμ(d)E(nd)∣≤∑d∣n∣μ(d)∣∣E(nd)∣≤∑d∣n∣μ(d)∣=2ω(n).\sum_{d\mid n}\mu(d)E\left(\frac{n}{d}\right)\le\left|\sum_{d\mid n}\mu(d)E\left(\frac{n}{d}\right)\right|\le\sum_{d\mid n}\left|\mu(d)\right|\left|E\left(\frac{n}{d}\right)\right|\le\sum_{d\mid n}\left|\mu(d)\right|=2^{\omega(n)}.

This last equality follows from the fact that ∣μ(d)∣=1|\mu(d)|=1 if and only if dd is a product of distinct prime factors, and ∣μ(d)∣=0|\mu(d)|=0 otherwise. Then

∑d∣nμ(d)E(nd)≥−∣∑d∣nμ(d)E(nd)∣≥−2ω(n)\sum_{d\mid n}\mu(d)E\left(\frac{n}{d}\right)\geq-\left|\sum_{d\mid n}\mu(d)E\left(\frac{n}{d}\right)\right|\geq-2^{\omega(n)}

and so

∑d∣nμ(d)ndab+∑d∣nμ(d)E(nd)≥ϕ(n)ab−2ω(n).\sum_{d\mid n}\mu(d)\frac{n}{dab}+\sum_{d\mid n}\mu(d)E\left(\frac{n}{d}\right)\geq\frac{\phi(n)}{ab}-2^{\omega(n)}.

This shows that

∣{(x,y)∈Z≥0×Z≥0:ax+by=n & gcd⁡(x,y)=1}∣≥ϕ(n)ab−2ω(n)\left|\{(x,y)\in\mathbb{Z}_{\geq0}\times\mathbb{Z}_{\geq0}: ax+by=n\ \&\ \gcd(x,y)=1\}\right|\geq\frac{\phi(n)}{ab}-2^{\omega(n)}

and by Lemma 4.2, for sufficiently large nn,

ϕ(n)>ab⋅2ω(n)⟺ϕ(n)ab>2ω(n)⟺ϕ(n)ab−2ω(n)>0.\phi(n)>ab\cdot2^{\omega(n)}\Longleftrightarrow\frac{\phi(n)}{ab}>2^{\omega(n)}\Longleftrightarrow\frac{\phi(n)}{ab}-2^{\omega(n)}>0.

Then for sufficiently large nn,

∣{(x,y)∈Z≥0×Z≥0:ax+by=n & gcd⁡(x,y)=1}∣≥ϕ(n)ab−2ω(n)>0\left|\{(x,y)\in\mathbb{Z}_{\geq0}\times\mathbb{Z}_{\geq0}: ax+by=n\ \&\ \gcd(x,y)=1\}\right|\geq\frac{\phi(n)}{ab}-2^{\omega(n)}>0

and since ∣{(x,y)∈Z≥0×Z≥0:ax+by=n & gcd⁡(x,y)=1}∣\left|\{(x,y)\in\mathbb{Z}_{\geq0}\times\mathbb{Z}_{\geq0}: ax+by=n\ \&\ \gcd(x,y)=1\}\right| is necessarily an integer, it follows that for sufficiently large nn,

∣{(x,y)∈Z≥0×Z≥0:ax+by=n & gcd⁡(x,y)=1}∣≥1.\left|\{(x,y)\in\mathbb{Z}_{\geq0}\times\mathbb{Z}_{\geq0}: ax+by=n\ \&\ \gcd(x,y)=1\}\right|\geq1.

Then there exists N∈ZN\in\mathbb{Z} such that for all n≥Nn\geq N, there is at least one solution to ax+by=nax+by=n such that x,y∈Z≥0x,y\in\mathbb{Z}_{\geq0} and gcd⁡(x,y)=1\gcd(x,y)=1; hence, g(a,b)<Ng(a,b)<N, which concludes the proof.

The above lemma and theorem also yield an upper bound for g(a,b)g(a,b): define N(a,b)N(a,b) to be p1p2⋯prp_1p_2\cdots p_r for the minimum rr satisfying 2ab<p3−12⋅p4−12⋯pr−122ab<\frac{p_3-1}{2}\cdot\frac{p_4-1}{2}\cdots\frac{p_r-1}{2}. By the above, this NN has the property that if n≥Nn\geq N, then ϕ(n)ab−2ω(n)>0\frac{\phi(n)}{ab}-2^{\omega(n)}>0, and hence g(a,b)<N(a,b)g(a,b)<N(a,b). We now have enough tools to begin computing exact values of g(a,b)g(a,b).

Exact Values

We first note that we can solve for g(a,b)g(a,b) precisely if a=1a=1 or a=2a=2.

Proposition 5.1. We have g(1,b)=b−1g(1,b)=b-1 if b≠2b\ne2 and g(1,2)=0g(1,2)=0.

This is easily proven directly, but also follows intuitively from writing the first several rows of Z(1,b)Z(1,b).

Proposition 5.2. If b>1b > 1 is odd, then g(2,b)=4b−2g(2,b) = 4b - 2.

Proof. We first claim 4b−2∉S(2,b)4b - 2 \notin S_{(2,b)} for any b∈Z≥0b \in\mathbb{Z}_{\ge0}. Suppose for contradiction that 4b−2∈S(2,b)4b - 2 \in S_{(2,b)}. It follows from Theorem 2.1 that 4b−2=2x+by4b - 2 = 2x + by for some x,y∈Z≥0x,y \in\mathbb{Z}_{\ge0} such that gcd⁡(x,y)=1\gcd(x,y) = 1. We divide into four cases based on the possible values of yy.

Case 1: yy is odd. Then 2x+by2x + by is odd, but since 4b−24b - 2 is even, this contradicts 4b−2=2x+by4b - 2 = 2x + by.

Case 2: y=2y = 2. Then 4b−2=2x+2b⟹x=b−14b - 2 = 2x + 2b \Longrightarrow x = b - 1, which implies xx is even. This contradicts gcd⁡(x,y)=1\gcd(x,y) = 1.

Case 3: y≥4y \ge4. Then 2x+by≥2x+4b≥4b>4b−22x + by \ge2x + 4b \ge4b > 4b - 2; this contradicts 4b−2=2x+by4b - 2 = 2x + by.

Case 4: y=0y = 0. Then

4b−2=2x⟹x=2b−1⟹1=gcd⁡(x,y)=gcd⁡(2b−1,0)=2b−1⟹b=1.4b - 2 = 2x \Longrightarrow x = 2b - 1 \Longrightarrow1 = \gcd(x,y) = \gcd(2b - 1,0) = 2b - 1 \Longrightarrow b = 1.

This contradicts the assumption that b>1b > 1.

These cases account for all possible values of yy, so it follows that there is no solution to 4b−2=2x+by4b - 2 = 2x + by such that x,y∈Z≥0x,y \in\mathbb{Z}_{\ge0} and gcd⁡(x,y)=1\gcd(x,y) = 1. Then g(2,b)≥4b−2g(2,b) \ge4b - 2 for b>1b > 1 odd.

We now claim that g(2,b)<4b−1g(2,b) < 4b - 1 by arguing that for all n≥4b−1n \ge4b - 1, we have n∈S(2,b)n \in S_{(2,b)}.

First, 4b−1=b+3b−14b - 1 = b + 3b - 1 where 3b−13b - 1 is even, so 4b−1=2⋅3b−12+b⋅14b - 1 = 2 \cdot\frac{3b-1}{2} + b \cdot1 where 3b−12,1∈Z≥0\frac{3b-1}{2}, 1 \in\mathbb{Z}_{\ge0} and gcd⁡(3b−12,1)=1\gcd\left(\frac{3b-1}{2},1\right) = 1. Then 4b−1∈S(2,b)4b - 1 \in S_{(2,b)}. Next, 4b=2b+2b=2⋅b+b⋅24b = 2b + 2b = 2 \cdot b + b \cdot2 where b,2∈Z≥0b,2 \in\mathbb{Z}_{\ge0} and gcd⁡(b,2)=1\gcd(b,2) = 1 because bb is odd, so 4b∈S(2,b)4b \in S_{(2,b)} as well.

We now consider 4b+k4b + k for k∈Z+k \in\mathbb{Z}^{+}. We divide again into cases, this time based on k mod 4k \bmod4, but will only argue the first explicitly.

Case 1: k≡1 mod 4k \equiv1 \bmod4. Then $4b + k = b + 3b + kwhere$3b+kwhere \$3b + k is even because 3,b,k3,b,k are odd, so 4b+k=2⋅3b+k2+b⋅14b + k = 2 \cdot\frac{3b+k}{2} + b \cdot1 where 3b+k2,1∈Z≥0\frac{3b+k}{2},1 \in\mathbb{Z}_{\ge0} and gcd⁡(3b+k2,1)=1\gcd\left(\frac{3b+k}{2},1\right) = 1.

Cases 2, 3, and 4, where k≡2,3k \equiv2,3, or 0 mod 40 \bmod4 respectively, follow similar arguments.

Then for all k∈Z+k \in\mathbb{Z}^{+}, 4b+k4b + k is expressible as 2x+by2x + by where x,y∈Z≥0x,y \in\mathbb{Z}_{\ge0} and gcd⁡(x,y)=1\gcd(x,y) = 1. Therefore g(2,b)<4b−1g(2,b) < 4b - 1 for all odd b>1b > 1, and together with the above, this proves g(2,b)=4b−2g(2,b) = 4b - 2 for all odd b>1b > 1.

We do not have closed formulae for g(a,b)g(a,b) outside of these cases, but can still compute exact values by testing down from the upper bound defined in the previous section. We define the function UpperBound in Mathematica, with exact code given in Figure 3. Given a choice of a,ba,b, UpperBound first finds those rr, beginning at r=3r = 3, for which

The Mathematica code of UpperBound

Figure 3. The Mathematica code of UpperBound, which computes the value N(a,b)N(a,b).

2ab≥p3−12⋅p4−12⋯pr−12;2ab \ge\frac{p_3-1}{2} \cdot\frac{p_4-1}{2} \cdots\frac{p_r-1}{2};

we know that at most finitely many of these rr exist, and that the right-hand side of this inequality is strictly increasing as a function of rr. If we then isolate the last rr for which the inequality holds and add one, we obtain the minimum rr satisfying 2ab<p3−12⋅p4−12⋯pr−122ab < \frac{p_3-1}{2} \cdot\frac{p_4-1}{2} \cdots\frac{p_{r-1}}{2}, at which point we set UpperBound(a,b)(a,b) equal to p1p2⋯prp_1p_2 \cdots p_r for this rr. This returns N(a,b)N(a,b) precisely.

We now wish to compare our upper bound to our known exact values. We note that by Proposition 5.1, g(1,999)=998g(1,999) = 998; by Proposition 5.2, g(2,999)=3994g(2,999) = 3994; and that by direct computation,

UpperBound[a_, b_] :=
    Product[Prime[k],
        {k, 1,
            Last[Flatten[For[r = 3, 2*a*b ≥ Product[(Prime[k] - 1)/2, {k, 3, r}], r++,
                Sow[r, {k, 1, r}]] // Reap] + 1}]

N(1,999)=N(2,999)=9699690N(1,999)=N(2,999)=9699690. It is natural to ask next, is this the best possible upper bound, or can we build a better one?

Computing an Alternate Upper Bound

To answer this question, we return to the original problem posed in terms of the Farey sequence. We first show that for gcd⁡(a,b)=1\gcd(a,b)=1, aa and bb will appear as neighboring denominators in some Farey sequence.

Proposition 6.1. For any choice of a,b≥2a,b\ge2 such that gcd⁡(a,b)=1\gcd(a,b)=1, there exist some s,ts,t such that ta,sb\frac{t}{a},\frac{s}{b} are consecutive terms in some Farey sequence.

Proof. Let gcd⁡(a,b)=1\gcd(a,b)=1 with a,b≥2a,b\ge2. Because a,ba,b are relatively prime, there necessarily exists some ss satisfying as≡1(modb)as\equiv1\pmod b and 1≤s≤b−11\le s\le b-1. Let t=(as−1)/bt=(as-1)/b; then t≥1t\ge1, and

bt=as−1≤a(b−1)−1=ab−a−1<ab,bt=as-1\le a(b-1)-1=ab-a-1<ab,

so t<at<a. Therefore ta,sb∈(0,1)\frac{t}{a},\frac{s}{b}\in(0,1). Additionally, it follows from t=(as−1)/bt=(as-1)/b that as−bt=1as-bt=1 and thus that gcd⁡(a,t)=gcd⁡(b,s)=1\gcd(a,t)=\gcd(b,s)=1, so ta,sb\frac{t}{a},\frac{s}{b} are irreducible. It also follows from as−bt=1as-bt=1 that sb−ta=1ab\frac{s}{b}-\frac{t}{a}=\frac{1}{ab} and thus that ta,sb\frac{t}{a},\frac{s}{b} are consecutive terms in Fmax⁡(a,b):=FkF_{\max(a,b)}:=F_k by [8]. □

We now consider the denominators that appear in terms between ta,sb\frac{t}{a},\frac{s}{b} in Farey sequence of sufficiently high order.

Proposition 6.2. If ta,sb\frac{t}{a},\frac{s}{b} are consecutive terms in the Farey sequence of order k:=max⁡(a,b)k:=\max(a,b), then dd appears as a denominator between ta,sb\frac{t}{a},\frac{s}{b} in some FmF_m with m>km>k if and only if d=ax+byd=ax+by for some x,y∈Nx,y\in\mathbb{N} with gcd⁡(x,y)=1\gcd(x,y)=1.

Proof. Let ta,sb\frac{t}{a},\frac{s}{b} be consecutive terms in the Farey sequence of order k:=max⁡(a,b)k:=\max(a,b).

(⟹)(\Longrightarrow) This direction was proved by Edward Sang in 1879 [9]. Essentially, every term between ta,sb\frac{t}{a},\frac{s}{b} must be of the form tx+syax+by\frac{tx+sy}{ax+by} for x,y∈Nx,y\in\mathbb{N}, and if gcd⁡(x,y)>1\gcd(x,y)>1, we find tx+syax+by\frac{tx+sy}{ax+by} is not in lowest terms. Thus every possible denominator dd appearing between ta,sb\frac{t}{a},\frac{s}{b} must be of the form ax+byax+by with gcd⁡(x,y)=1\gcd(x,y)=1. (⟸)(\Longleftarrow) Let x,y∈Nx,y \in\mathbb{N} with gcd⁡(x,y)=1\gcd(x,y)=1 and d=ax+byd=ax+by. Since gcd⁡(x,y)=1\gcd(x,y)=1, there exist j,k∈Zj,k \in\mathbb{Z} such that jx+ky=1jx+ky=1. We know that “if hk\frac{h}{k} and h′k′\frac{h'}{k'} are two successive terms of FnF_n, then kh′−hk′=1kh'-hk'=1” [2], so as−bt=1as-bt=1. Observe (ak−bj),(js−kt)∈Z(ak-bj),(js-kt) \in\mathbb{Z} and that

(ak−bj)(tx+sy)+(js−kt)(ax+by)=aktx+aksy−bjtx−bjsy+ajsx+bjsy−aktx−bkty=ajsx−bjtx+aksy−bkty=jx(as−bt)+ky(as−bt)=jx+ky=1.\begin{aligned} (ak-bj)(tx+sy)+(js-kt)(ax+by) &= aktx+aksy-bjtx-bjsy+ajsx+bjsy-aktx-bkty\\ &= ajsx-bjtx+aksy-bkty\\ &= jx(as-bt)+ky(as-bt)\\ &= jx+ky\\ &=1. \end{aligned}

and it follows that gcd⁡(tx+sy,ax+by)=1\gcd(tx+sy,ax+by)=1. Furthermore, it follows from as−bt=1as-bt=1 that bt<asbt<as, and so

btx<asx⟹btx+bsy<asx+bsy⟹b(tx+sy)<s(ax+by)⟹tx+syax+by<sb.btx<asx \Longrightarrow btx+bsy<asx+bsy \Longrightarrow b(tx+sy)<s(ax+by) \Longrightarrow\frac{tx+sy}{ax+by}<\frac{s}{b}.

and

bty<asy⟹atx+bty<atx+asy⟹t(ax+by)<a(tx+sy)⟹ta<tx+syax+by.bty<asy \Longrightarrow atx+bty<atx+asy \Longrightarrow t(ax+by)<a(tx+sy) \Longrightarrow\frac{t}{a}<\frac{tx+sy}{ax+by}.

Therefore tx+syax+by=tx+syd\frac{tx+sy}{ax+by}=\frac{tx+sy}{d} appears somewhere between ta\frac{t}{a} and sb\frac{s}{b} in all Farey sequences of order at least dd.

Corollary 6.3. A number dd appears as a denominator between ta\frac{t}{a} and sb\frac{s}{b} inclusive in some Farey sequence if and only if d∈S(a,b)d \in S_{(a,b)} as defined in § 2.

Proof. This follows immediately from Theorem 2.1 and Proposition 6.2.

Corollary 6.4. If all n>Nn>N appear as denominators between ta\frac{t}{a} and sb\frac{s}{b} in some FmF_m with m>max⁡(a,b)m>\max(a,b), then g(a,b)≤Ng(a,b)\le N.

Proof. This follows immediately from Corollary 6.3 and the fact that g(a,b)=sup⁡(Z∖S(a,b))g(a,b)=\sup(\mathbb{Z}\setminus S_{(a,b)}).

We note that nn does not appear as a denominator between ta,sb\frac{t}{a},\frac{s}{b} in any Farey sequence if and only if for every ii satisfying ta<in<sb\frac{t}{a}<\frac{i}{n}<\frac{s}{b}, we have gcd⁡(i,n)>1\gcd(i,n)>1. We further note

ta<in<sb⟺tan<i<sbn,\frac{t}{a}<\frac{i}{n}<\frac{s}{b}\Longleftrightarrow\frac{t}{a}n<i<\frac{s}{b}n,

and it follows that the number of ii that must satisfy gcd⁡(i,n)>1\gcd(i,n)>1 in order for nn not to appear as a denominator between ta,sb\frac{t}{a},\frac{s}{b} is ⌊snb⌋−⌈tna⌉+1\left\lfloor\frac{sn}{b}\right\rfloor-\left\lceil\frac{tn}{a}\right\rceil+1. We observe

⌊snb⌋−⌈tna⌉+1=⌊snb⌋+⌊−tna⌋+1≥⌊snb−tna⌋=⌊asn−btnab⌋=⌊n(as−bt)ab⌋=⌊n(1)ab⌋=⌊nab⌋≥nab−1.\left\lfloor\frac{sn}{b}\right\rfloor-\left\lceil\frac{tn}{a}\right\rceil+1 =\left\lfloor\frac{sn}{b}\right\rfloor+\left\lfloor-\frac{tn}{a}\right\rfloor+1 \ge\left\lfloor\frac{sn}{b}-\frac{tn}{a}\right\rfloor =\left\lfloor\frac{asn-btn}{ab}\right\rfloor =\left\lfloor\frac{n(as-bt)}{ab}\right\rfloor =\left\lfloor\frac{n(1)}{ab}\right\rfloor =\left\lfloor\frac{n}{ab}\right\rfloor \ge\frac{n}{ab}-1.

This expression has the benefit of not depending on s,ts,t.

It now becomes expedient to invoke the Jacobsthal function j(n)j(n), which is defined for n≥1n \ge1 as the smallest integer such that any sequence of j(n)j(n) consecutive integers contains an element relatively prime to nn [10]. Then j(n)−1j(n)-1 is the maximum length of a string of consecutive integers not relatively prime to nn, and if j(n)−1<nab−1j(n)-1 < \frac{n}{ab}-1 or equivalently, j(n)<nabj(n) < \frac{n}{ab}, it follows by the above that nn is a denominator appearing between ta,sb\frac{t}{a},\frac{s}{b} in Farey sequences of sufficiently high order. For

h(r):=j(p1p2⋯pr)h(r) := j(p_1p_2\cdots p_r)

and

H(r):=max⁡ω(n)=rj(n),H(r) := \max_{\omega(n)=r} j(n),

Hajdu and Saradha have shown H(r)=h(r)H(r)=h(r) for r≤23r \le23 and H(24)>h(24)H(24)>h(24) [10]. Additionally, h(r)h(r) is strictly increasing for r≤63r \le63 [11]. We note that for all cases we have considered thus far, N(a,b)<p1p2⋯p23=267064515689275851355624017992790N(a,b)<p_1p_2\cdots p_{23}=267064515689275851355624017992790.

We combine these facts with our previous upper bound N(a,b)N(a,b) defined in § 4 to obtain an improved upper bound:

Theorem 6.5. For N(a,b)≤p1p2⋯p23N(a,b)\le p_1p_2\cdots p_{23}, we have g(a,b)≤ab⋅j(N(a,b))<N(a,b)g(a,b)\le ab\cdot j\left(N(a,b)\right)<N(a,b).

Proof. Recall N(a,b)N(a,b) is defined as p1p2⋯prp_1p_2\cdots p_r for the minimum rr satisfying 2ab<p3−12⋅p4−12⋯pr−122ab<\frac{p_3-1}{2}\cdot\frac{p_4-1}{2}\cdots\frac{p_r-1}{2}, so ω(N(a,b))=r\omega\left(N(a,b)\right)=r. For m≤N(a,b)m\le N(a,b), we know j(m)≤H(r)j(m)\le H(r), and so the maximum length of any string of consecutive integers not relatively prime to mm, that is, j(m)−1j(m)-1, is bounded above by H(r)−1=h(r)−1=j(N(a,b))−1H(r)-1=h(r)-1=j\left(N(a,b)\right)-1. Since

j(N(a,b))−1<mab−1⟺m>ab⋅j(N(a,b)),j\left(N(a,b)\right)-1<\frac{m}{ab}-1\Longleftrightarrow m>ab\cdot j\left(N(a,b)\right),

it follows that if m≤N(a,b)m\le N(a,b) and m>ab⋅j(N(a,b))m>ab\cdot j\left(N(a,b)\right), then j(m)≤j(N(a,b))<mabj(m)\le j\left(N(a,b)\right)<\frac{m}{ab} and so mm appears as a denominator between ta,sb\frac{t}{a},\frac{s}{b} in Farey sequences of sufficiently high order.

We know 2ab<p3−12⋅p4−12⋯pr−122ab<\frac{p_3-1}{2}\cdot\frac{p_4-1}{2}\cdots\frac{p_r-1}{2}, so

ab<12⋅1⋅p3−12⋅p4−12⋯pr−12=p1−12⋅p2−12⋅p3−12⋅p4−12⋯pr−12.ab<\frac{1}{2}\cdot1\cdot\frac{p_3-1}{2}\cdot\frac{p_4-1}{2}\cdots\frac{p_r-1}{2}=\frac{p_1-1}{2}\cdot\frac{p_2-1}{2}\cdot\frac{p_3-1}{2}\cdot\frac{p_4-1}{2}\cdots\frac{p_r-1}{2}.

Additionally, j(N(a,b))≤2ω(N(a,b))=2rj\left(N(a,b)\right)\le2^{\omega(N(a,b))}=2^r by [12], so

ab⋅j(N(a,b))<p1−12⋅p2−12⋅p3−12⋅p4−12⋯pr−12⋅2r=(p1−1)(p2−1)⋯(pr−1)<p1p2⋯pr=N(a,b).\begin{aligned} ab\cdot j\left(N(a,b)\right)&<\frac{p_1-1}{2}\cdot\frac{p_2-1}{2}\cdot\frac{p_3-1}{2}\cdot\frac{p_4-1}{2}\cdots\frac{p_r-1}{2}\cdot2^r\\ &=(p_1-1)(p_2-1)\cdots(p_r-1)\\ &<p_1p_2\cdots p_r\\ &=N(a,b). \end{aligned}

It follows that all mm satisfying ab⋅j(N(a,b))<m≤N(a,b)ab\cdot j(N(a,b)) < m \le N(a,b) appear as denominators between ta,sb\frac{t}{a},\frac{s}{b} in Farey sequences of sufficiently high order, and thus that g(a,b)≤ab⋅j(N(a,b))<N(a,b)g(a,b) \le ab\cdot j(N(a,b)) < N(a,b) by Corollary 6.4.

We include Table 1 as an illustration of the growth rate of the product of the first rr primes compared to the Jacobsthal function applied to the product of the first rr primes. We can further refine the upper bound derived using the latter as follows:

rr123456789
p1p2⋯prp_1p_2\cdots p_r26302102310300305105109699690223092870
j(p1p2⋯pr)j(p_1p_2\cdots p_r)246101422263440

Table 1. For each r≤9r \le9, the product of the first rr primes is given as well as the Jacobsthal function applied to these products. For 2≤r≤232 \le r \le23, if p1p2⋯prp_1p_2\cdots p_r is an upper bound for g(a,b)g(a,b), then ab⋅j(p1p2⋯pr)ab\cdot j(p_1p_2\cdots p_r) is an improved upper bound.

Corollary 6.6. For N(a,b)≤p1p2⋯p23N(a,b) \le p_1p_2\cdots p_{23}, we have

g(a,b)≤ab⋅j(N(a,b)pq+1⋅pq+2⋯pr)g(a,b) \le ab\cdot j\left(\frac{N(a,b)}{p_{q+1}\cdot p_{q+2}\cdots p_r}\right)

for qq the maximum integer such that p1p2⋯pq≤ab⋅j(N(a,b))p_1p_2\cdots p_q \le ab\cdot j(N(a,b)).

Proof. We know by Theorem 6.5 that ab⋅j(N(a,b))<N(a,b)ab\cdot j(N(a,b)) < N(a,b). Then ω(ab⋅j(N(a,b)))<r\omega(ab\cdot j(N(a,b))) < r, as N(a,b)N(a,b) is the smallest positive integer satisfying ω(N(a,b))=r\omega(N(a,b)) = r. Then for m≤ab⋅j(N(a,b))m \le ab\cdot j(N(a,b)), the maximum length of any string of consecutive integers not relatively prime to mm is

H(q)−1=h(q)−1=j(N(a,b)/(pq+1⋅pq+2⋯pr))−1H(q)-1=h(q)-1=j\left(N(a,b)/(p_{q+1}\cdot p_{q+2}\cdots p_r)\right)-1

where qq is the maximum integer such that p1⋅p2⋯pq<ab⋅j(N(a,b))p_1\cdot p_2\cdots p_q < ab\cdot j(N(a,b)). Repeating the logic of Theorem 6.5, it follows that all mm satisfying

ab⋅j(N(a,b)/(pq+1⋅pq+2⋯pr))<m<ab⋅j(N(a,b))ab\cdot j\left(N(a,b)/(p_{q+1}\cdot p_{q+2}\cdots p_r)\right) < m < ab\cdot j(N(a,b))

appear as denominators between ta,sb\frac{t}{a},\frac{s}{b} in Farey sequences of sufficiently high order, and thus that

g(a,b)≤ab⋅j(N(a,b)/(pq+1⋅pq+2⋯pr))<ab⋅j(N(a,b))g(a,b) \le ab\cdot j\left(N(a,b)/(p_{q+1}\cdot p_{q+2}\cdots p_r)\right) < ab\cdot j(N(a,b))

by Corollary 6.4.

We may be able to iterate Corollary 6.6 to further improve the upper bound, and we may be able to improve the upper bound via another method as well:

Remark 6.7. If we can show g(a,b)≠ng(a,b) \ne n for all n≤ab⋅j(N(a,b)/(pq+1⋅pq+2⋯pr))n \le ab \cdot j\left(N(a,b) / (p_{q+1} \cdot p_{q+2} \cdots p_r)\right) satisfying ω(n)=q\omega(n) = q in Corollary 6.6, we may replace qq with q−1q - 1 in the process above. It may be possible to iterate this step.

We examine the case of a=5,b=7a = 5, b = 7 to better illustrate the process of determining this upper bound as well as its strength. We first calculate N(5,7)=30030N(5, 7) = 30030, our previous best known upper bound for g(5,7)g(5, 7). By Theorem 6.5, we now know g(5,7)≤5⋅7⋅j(30030)=35⋅22=770g(5, 7) \le5 \cdot7 \cdot j(30030) = 35 \cdot22 = 770, and by Corollary 6.6, we may replace 30030 with 210 to obtain g(5,7)≤5⋅7⋅j(210)=350g(5, 7) \le5 \cdot7 \cdot j(210) = 350. It takes Mathematica less than a second to determine that 210 and 330 are the only integers nn such that ω(n)=4\omega(n) = 4 and n≤350n \le350, and less than a second to verify that 5x+7y=210,5x+7y=3305x + 7y = 210, 5x + 7y = 330 both have solutions where gcd⁡(x,y)=1\gcd(x, y) = 1. It follows that g(5,7)≤5⋅7⋅j(30)=5⋅7⋅6=210g(5, 7) \le5 \cdot7 \cdot j(30) = 5 \cdot7 \cdot6 = 210. We cannot further refine the bound, as there are multiple integers n≤210n \le210 with ω(n)=3\omega(n) = 3 such that 5x+7y=n5x + 7y = n has no solutions satisfying gcd⁡(x,y)=1\gcd(x, y) = 1. By starting at n=210n = 210 and counting down to the first n′≤210n' \le210 such that 5x+7y=n′5x + 7y = n' has no solutions satisfying gcd⁡(x,y)=1\gcd(x, y) = 1, we obtain g(5,7)=156g(5, 7) = 156.

For the above case, we note that 156 was both the maximum integer satisfying ω(n)=3\omega(n) = 3 with no suitable solutions to 5x+7y=1565x + 7y = 156 and the exact value of g(5,7)g(5, 7). However, this is not always the case: the maximum integer satisfying ω(n)=5\omega(n) = 5 with no relatively prime integer solutions to 49x+93y=n49x + 93y = n is 33930, but we find g(49,93)=40080g(49, 93) = 40080 and ω(40080)=4\omega(40080) = 4. In other words, we can use this method to derive an improved upper bound, but not an exact value of g(a,b)g(a, b). However, with an improved upper bound, we can find exact values of g(a,b)g(a, b) more quickly through the process referenced in § 5 and indicated by the code shown in Figure 4. Mathematica runs this code as follows: it starts with a given upper bound NN on g(a,b)g(a, b). FrobeniusSolve then gives all pairs of non-negative integers (x,y)(x, y) that are solutions to ax+by=Nax + by = N, and GCDs computes gcd⁡(x,y)\gcd(x, y) for each pair. AnyOnes determines if gcd⁡(x,y)=1\gcd(x, y) = 1 for any pair, and the exclamation point in front means we determine if gcd⁡(x,y)≠1\gcd(x, y) \ne1 for all pairs. When this condition is not true, that is, when there is at least one pair satisfying gcd⁡(x,y)=1\gcd(x, y) = 1, we rule out NN as the possible value of g(a,b)g(a, b) and the while loop moves on to N−1N - 1 to try again. The first time we reach an nn such that ax+by=nax + by = n has no non-negative integer solutions satisfying gcd⁡(x,y)=1\gcd(x, y) = 1, the condition that gcd⁡(x,y)≠1\gcd(x, y) \ne1 for all pairs is true, we know we have found g(a,b)g(a, b), and the loop terminates. Using this code with the computing power of the University of Illinois Campus Cluster, we can derive exact values of g(a,b)g(a, b) for all pairs a,b≤200a, b \le200 with gcd⁡(a,b)=1\gcd(a, b) = 1, as shown in Figure 5.

Mathematica code
n = [upper bound];
While[True,
    If[! AnyOnes[GCDs[FrobeniusSolve[{a, b}, n]]],
        Print[n]];
    n--]

Figure 4. Mathematica code that computes g(a,b)g(a,b), given an upper bound, utilizing custom functions GCDs and AnyOnes.

A plot of g(a, b) for all pairs a, b ≤ 200 with gcd(a, b) = 1

Figure 5. A plot of g(a,b)g(a,b) for all pairs a,b≤200a,b \le200 with gcd⁡(a,b)=1\operatorname{gcd}(a,b)=1.

Future Directions

With the glut of new data generated in the previous section, we can search for patterns to tell us more about the behavior of g(a,b)g(a, b). In particular, one new theorem and two new conjectures arise.

Theorem 7.1. For all gcd⁡(ua,b)=gcd⁡(a,b)=1\gcd(ua,b) = \gcd(a,b) = 1 and u>1u > 1, we have g(ua,b)≥u⋅g(a,b)g(ua,b) \ge u \cdot g(a,b).

This is not difficult to prove by contradiction. The following conjectures hold for all data points generated thus far:

Conjecture 7.2. For all a,b≥2a,b \ge2 relatively prime, we have g(a,b)≥4f(a,b)g(a,b) \ge4f(a,b).

Conjecture 7.3. For all a,b≥3a,b \ge3 relatively prime and for c(a,b)c(a,b) the minimum integer satisfying both c(a,b)>bc(a,b) > b and gcd⁡(c(a,b),a)=1\gcd(c(a,b),a) = 1, we have g(a,c(a,b))/g(a,b)≤5g(a,c(a,b))/g(a,b) \le5.

One natural future direction is to see if these conjectures can be proved or disproved. We also encounter a pattern that is somewhat too subtle to propose as a formal conjecture: define KK to be the set of all data points (a,b,g(a,b))(a,b,g(a,b)) with 3≤a<b≤2003 \le a < b \le200. Then ∣K∣=11933\lvert K\rvert= 11933, and by comparing 11933 divided by a prime pp to the number of data points for which pp divides g(a,b)g(a,b), we observe that g(a,b)g(a,b) seems to be disproportionately divisible by small primes: see Figure 6. What exactly is this pattern telling us, and how might we prove what we see is true?

Bar chart comparing the number of points in K divisible by each prime with 11933 divided by the prime

Figure 6. Along the xx-axis, primes pp between 2 and 97 are plotted. In the yellow/leftmost of each pair of bars, the number of points in KK for which g(a,b)g(a,b) is divisible by pp is plotted, and in the blue/rightmost of each pair of bars, 11933/pp, that is, the size of KK divided by pp, is plotted.

Another avenue for future study concerns focusing on the cases where b=3,4,6b = 3, 4, 6, as there appears to be a rich but puzzling structure here. We focus on b=3b = 3, a≡1 mod 3a \equiv1 \bmod3 to illustrate our point in Figure 7. At each stage, g(a,b)g(a,b) appears to be a roughly linear step function of aa, with some aberrations in step size, but interestingly, we find different typical step sizes when we consider a≤100a \le100, a≤1000a \le1000, a≤10000a \le10000, and a≤100000a \le100000 separately. What causes the step sizes to vary? Can we extrapolate what would happen if we consider a≤1000000a \le1000000 from the graphs given? How do we account for the atypical steps?

Four graphs of $g(a,b)$ as a function of $a$ for increasing upper bounds

Figure 7. For b=3b = 3 and a≡1(mod3)a \equiv1 \pmod{3}, g(a,b)g(a,b) is graphed as a function of aa for a≤100a \le100, a≤1000a \le1000, a≤10000a \le10000, and a≤100000a \le100000.

Our focus thus far has been limited to finding g(a,b)g(a,b), the greatest integer inexpressible as ax+byax+by under the given conditions, but what of the other inexpressible integers less than g(a,b)g(a,b)? Is there structure lurking in their distribution? This is another puzzle for which further study may prove fruitful.

References

  1. [1]Eisenstein, G. (1975). Personal letters to Stern. Mathematische Werke. pp. 818-819. Chelsea Pub. Co.
  2. [2]Hardy, G.H. and E.M. Wright. (1979). An Introduction to the Theory of Numbers, pp. 23-24. Oxford University Press.
  3. [3]Reznick, Bruce. (2012). Stern Notes. Math 595, University of Illinois, Urbana-Champaign. Spring 2012.
  4. [4]Reznick, Bruce. (2008). Regularity properties of the Stern enumeration of the rationals. Journal of Integer Sequences, Volume 11 (2008), Article 08.4.1, 17 pp., (MR2447843, 2009g:11016, arXiv – math/0610601).
  5. [5]Graham, R.L., D.E. Knuth, and O. Patashnik. (1990). Concrete Mathematics. pp. 115-123. Reading, MA: Addison-Wesley.
  6. [6]Tripathi, Amitabha. (2016). Formulae for the Frobenius number in three variables. Journal of Number Theory, Volume 170 (January 2017), pp. 368-389. https://doi.org/10.1016/j.jnt.2016.05.027.
  7. [7]Apostol, Tom M. (1976). Introduction to Analytic Number Theory, pp. 26-27. New York, NY: Springer.
  8. [8]Apostol, Tom. (1976). Modular Functions and Dirichlet Series in Number Theory, pp. 97-99. New York, NY: Springer.
  9. [9]Sang, Edward. (1879). On the Tabulation of all Fractions having their Values between Two Prescribed Limits. Transactions of the Royal Society of Edinburgh, Volume 28 (1879), pp. 287-298.DOI
  10. [10]Hajdu, L. and Saradha, N. (2012). Disproof of a Conjecture of Jacobsthal. Mathematics of Computation, Volume 81, Number 280 (October 2012), pp. 2461-2471. https://doi.org/10.1090/S0025-5718-2012-02581-6.
  11. [11]OEIS Foundation Inc. (2020). The On-Line Encyclopedia of Integer Sequences. https://oeis.org/.
  12. [12]Costello, Fintan and Paul Watts. (2015). An Upper Bound on Jacobsthal’s Function. Mathematics of Computation, Volume 84, Number 293 (May 2015), pp. 1389-1399. https://www.jstor.org/stable/24488894.DOI

Paper details

vlnc:W_ahch9c5x
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents