I have a real interval $\mathbb{S} \subset ]0; 1[$.
How can I find the smallest $n \in \mathbb{N}$, for which there is a $k \in \mathbb{N}$, for which $\frac{k}{n} \in \mathbb{S}$?
1The important thing is to do this effectively. For example, just trying all the possible denominators $\frac{1}{d-c}$ for the interval $]c, d[$, would work, but it is obviously not effective (like if we would decide the least common multiple of two natural numbers by trying all the natural numbers smaller than their multiple).
2The problem came into my mind as an interesting, l'art pour l'art programming problem, what I formulated also as a codegolf challenge. However, meanwhile I became curious also to the math side, which can be the optimal algorithm, or a nearly optimal one.