Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Generate a list of fractions with a bounded denominator
ResourceFunction["FareyRange"][xmin,xmax,n] generates the sorted list of rational numbers with denominators not exceeding n within the interval xmin to xmax. |
All fractions in the interval 0 to 2 with denominators not exceeding 5:
In[1]:= |
Out[1]= |
The bounds can be inexact numbers:
In[2]:= |
Out[2]= |
FareyRange can be used to find low-denominator approximations to a pair of close values:
In[3]:= |
Out[3]= |
This work is licensed under a Creative Commons Attribution 4.0 International License