New Software and Platforms
Bilateral Contracts and Grants with Industry
Partnerships and Cooperations
Bibliography
 PDF e-Pub

## Section: New Results

### Stern-Brocot and Fibonacci sequences

Participant : José Grimm.

We constructed an explicit bijection $𝐍\to 𝐐$, first in the framework of the Bourbaki project (see above), then in Ssreflect. Every positive rational number $x$ can uniquely be written as a quotient ${s}_{n}/{s}_{n+1}$. This result was established by Dijkstra who stated it in an obfuscated way. It was shown years before by Stern. It is possible to compute ${s}_{n}/{s}_{n+1}$ without computing numerator and denominator separately, by considering the sequences of bits of $n$ from left to right or from right to left. Truncating the binary expansion of $n$ yields a sequence of approximations to ${s}_{n}/{s}_{n+1}$ (this was studied by Brocot, and the so-called Stern-Brocot tree is an alternative representation of rational numbers). We implemented the work of Dijkstra and Stern in Coq [17] .

We also studied how a number can be represented by a sequence of other numbers (for instance as a sum of distinct Fibonacci numbers, with or without constraints). The number of ways of writing $n$ as a sum of powers of two, each power of two being used at most twice, is ${s}_{n+1}$. These results are presented in [17] .