OFFSET
1,1
LINKS
Eric Weisstein's World of Mathematics, Farey Sequence.
Wikipedia, Farey Sequence.
EXAMPLE
For n = 5, we have the Farey sequence F_5 = {0, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1} with 11 terms, and the corresponding sequence S_5 = {0, 1/10, 1/5, 3/10, 2/5, 1/2, 3/5, 7/10, 4/5, 9/10, 1} consisting of the 11 equidistant fractions {x/10} with 0 <= x <= 10. Since there are 7 fractions (0, 1/5, 2/5, 1/2, 3/5, 4/5, 1) common to both sequences, F_5 and S_5, then a(5) = 7.
MATHEMATICA
a[n_]:= Module[{len, fn, sn},
fn = FareySequence[n];
len = Length[fn];
sn = Range[0, len - 1]/(len - 1);
Intersection[fn, sn] // Length];
Table[a[j], {j, 1, 80}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Andres Cicuttin, May 26 2023
STATUS
approved