Ordered Fractions

Assume that the irreducible fractions between 0 and 1, with denominators at most 99, are listed in ascending order. Determine which two fractions are adjacent to 11/21 in this listing.

Determine which two fractions are adjacent to 34/87 in this listing.

Is it possible to generalize this to finding the fractions adjacent to a/b?

Source: Modified from Problem 2/3/12 at the USA Mathematical Talent Search.


Solutions were received from Dave Ellis, Henry Bottomley, Claudio Baiocchi, Sudipta Das, Kirk Bresniker, John Hewson, Philippe Fondanaiche, Larry Corrado, and Stephane Higueret.

First the solutions:
45/86 < 11/21 < 43/82
25/64 < 34/87 < 9/23

Stephanie Higueret's solution is most straightforward:

The irreducible fractions between 0 and 1, with denominators at most 99,
are listed in ascending order is the Farey series (generally Stern Brocot
tree).

Three adjacent fractions c/d, a/b, e/f followed the properties :
ad - bc = 1
be - af = 1 ((c+e)/(d+f)=a/b, a/b is the median fraction between c/d and
e/f)

So with a/b = 11/21
11d - 21c = 1 gives c/d = 45/86
21e - 11f = 1 gives e/f = 43/82

and a/b = 34/87
34d - 87c = 1 gives c/d = 25/64
87e - 34f = 1 gives e/f = 9/23

I forget to precise that they could exist many solutions for ad-bc = 1.
It was obvious to select the one's with the highest denominator.

In case of a/b = 34/87 there's only one solution,
but for a/b = 11/21 if we search c/d we found 5 solutions
1/2, 12/23, 23/44, 34/65 and 45/86 of course only the last one matched
the criteria.

Mail to Ken