## Consider the fraction, $\dfrac n d$, where $n$ and $d$ are positive integers. If $n \lt d$ and $\operatorname{HCF}(n,d)=1$, it is called a reduced proper fraction.

If we list the set of reduced proper fractions for $d \le 8$ in ascending order of size, we get:

$$\frac 1 8, \frac 1 7, \frac 1 6, \frac 1 5, \frac 1 4, \frac 2 7, \frac 1 3, \frac 3 8, \mathbf{\frac 2 5}, \frac 3 7, \frac 1 2, \frac 4 7, \frac 3 5, \frac 5 8, \frac 2 3, \frac 5 7, \frac 3 4, \frac 4 5, \frac 5 6, \frac 6 7, \frac 7 8$$

It can be seen that $\dfrac 2 5$ is the fraction immediately to the left of $\dfrac 3 7$.

By listing the set of reduced proper fractions for $d \le 1\,000\,000$ in ascending order of size, find the numerator of the fraction immediately to the left of $\dfrac 3 7$.

### The fraction 3/7 is a series of Farey sequences, in which every term is the mediant of the two terms on either side of it.

If we’re looking at the fraction to the left of 3/7 in a Farey sequence, it means we want to find the largest fraction less than 3/7 which has a denominator of less than or equal to 1,000,000.

Since 3/7 is obtained by taking the mediant of 2/5 and 1/2 (you sum up the numerators and the denominators separately), the fraction preceding 3/7 will be

(2 + n) / (5 + d) where n/d is a previous fraction in the sequence (and must be less than 3/7), and d is less than or equal to 1,000,000.

So, we need to find the maximum n such that (2 + n) / (5 + d) < 3/7 and d ≤ 1,000,000. We can rearrange this to find n = 7d - 3 - 2d = 5d - 3. We know that d must be less than or equal to 1,000,000, so the maximum value for n happens when d = 1,000,000, in which case n = 5,000,000 - 3 = 4,999,997. Thus, the numerator of the fraction immediately to the left of 3/7 in the Farey sequence for d ≤ 1,000,000 is 4,999,997.

##### More Answers:

Magic 5-gon RingTotient Maximum

Totient Permutation