February’s last day and I wanna to write a little bit before to end this short month, so this time let’s take a look at Farey Sequence It’s useful to find rational approximations of irrational numbers, for computer science applications is used as digital image processing and for math contests, there some nice problems about it. So, here we go…

## Definition

For any positive integer $n$, the Farey sequence $F_{n}$ is the sequence of rational numbers $a/b$ with $0 \leq a \leq b \leq n$ and $(a, b) = 1$ arranged in increasing order. For instance, $F_{3} = \{ \frac{0}{1}, \frac{1}{3}, \frac{1}{2}, \frac{2}{3}, \frac{1}{1} \}$

By generalizing:

Where $\varphi(n)$ is the Euler’s totient function, defined as the number of integers $k$ in range $1 \leq k \leq n$ for which the greatest common divisor $\gcd(n, k) = 1$

## Theorem

If $p_{1}/q_{1}$, $p_{2}/q_{2}$ and $p_{3}/q_{3}$ are three successive terms in a Farey sequence, then

## Example

$1.-$ (IMO 1967) Which fraction $p/q$, where $p, q$ are positive integers less than $100$, is closest to $\sqrt{2}$? Find all digits after the decimal point in the decimal representation of this fraction that coincide with digits in the decimal representation of $\sqrt{2}$.

We have that

Because $\vert p^2 - 2q^2 \vert \geq 1$.

The greatest $p, q \leq 100$ satisfying the equation $\vert p^2 - 2q^2 \vert = 1$ are $(p, q) = (99, 70)$. It’s easy to verify using $(1)$ that $\frac{99}{70}$ best approximates $\sqrt{2}$ among the fractions $p/q$ with $p, q \leq 100$. The numbers $\frac{99}{70} = 1.41428$ and $\sqrt{2}$ coincide up to the fourth decimal digit: Indeed, $(1)$ gives $% $

By using some basic facts about Farey sequences, one can find that $% $ implies $p \geq 41 + 99 > 100$ because $99.29 - 41.70 = 1$. Of the two fractions $\frac{41}{29}$ and $\frac{99}{70}$, the later is closer to $\sqrt{2}$