"# [Counting Fractions in a Range](https://projecteuler.net/problem=73)\n",
"\n",
"As mentioned in [problem 71](https://projecteuler.net/problem=71), it's easy to compute the next value to appear between two neighbors in a Farey sequence by computing their mediant. Using this fact, we can can repeatedly calculate mediants to get *every* value between two neighbors in the sequence, stopping when the denominators get too big - in fact, for this problem, we *only* need to calculate the denominators.\n",
"\n",
"This essentially amounts to a depth-first search of the [Stern-Brocot tree](https://en.wikipedia.org/wiki/Stern%E2%80%93Brocot_tree) - check it out if you'd like a visualization.\n",
"\n",
"Theoretically, we could count using a recursive function, but Python will hit its recursion limit if we try to use it to solve this problem."
"This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/) and the [BSD Zero Clause license](https://spdx.org/licenses/0BSD.html)."