Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #12 Mar 08 2023 06:30:47
%S 0,1,2,0,2,2,2,0,0,2,0,2,0,0,0,2,2,0,2,2,0,2,0,0,2,2,0,2,0,2,0,2,0,0,
%T 0,0,2,2,2,0,0,0,0,0,0,0,2,2,0,2,2,2,0,2,2,2,0,0,0,0,4,0,0,0,6,0,0,2,
%U 4,2,0,2,0,0,2,2,0,0,2,0,0,0,0,2,0,0,2,0,2,0,2,2,2,2,0,2,2,0,0,0,0,0,0,0,0
%N Consider the Farey sequence of order n, F_n, and that the average distance between any two adjacent pairs in F_n is 1/A002088(n). Then a(n) is the number of adjacent pairs whose difference is the average.
%C Because the Farey fractions are symmetrical about 1/2 for n > 1, a(n) is always even.
%C First occurrence of k by index, or -1 if no such occurrence exists: 0, 1, 2, -1, 60, -1, 64, -1, 207, -1, 1047, -1, 1084, -1, ..., .
%C Where 0 occurs: 0, 3, 7, 8, 10, 12, 13, 14, 17, 20, 22, 23, 26, 28, 30, 32, 33, ..., ;
%C Where 2 occurs: 2, 4, 5, 6, 9, 11, 15, 16, 18, 19, 21, 24, 25, 27, 29, 31, 36, 37, 38, ..., ;
%C Where 4 occurs: 60, 68, 120, 129, 148, 158, 159, 168, 180, 216, 225, 231, 239, 241, 249, ..., ;
%C Where 6 occurs: 65, 227, 401, 403, 492, 600, 616, 780, 861, 862, 865, 967, 1019, 1054, ..., ;
%C Where 8 occurs: 208, 1210, 1367, 1803, 1804, 1841, 1866, 2397, 2864, 3281, 3443, 3724, ..., ;
%C Where 10 occurs: 1048, 1094, 1632, 1949, 2269, 2571, 2710, 3365, 3555, 3558, 3613, 3939, ..., ;
%C Where 12 occurs: 1085, 1358, 2541, 3251, 4411, ..., ;
%C Where 18 occurs: 4830, ..., ;
%C For the first 5001 terms: 3315 zeros, 1 one, 1138 twos, 414 fours, 96 sixes, 19 eights, 12 tens, 5 twelves and 1 eighteen.
%D Albert H. Beiler, Recreations in the Theory of Numbers, The Queen of Mathematics Entertains, Chapter XVI, "Farey Tails", Dover Books, NY, 1966, pgs 168-172.
%H Cut the Knot, <a href="http://www.cut-the-knot.org/blue/Farey.shtml">Farey Series</a>.
%H The University of Surrey, Math Dept., <a href="https://r-knott.surrey.ac.uk/Fractions/fareySB.html">Fractions in the Farey Series and the Stern-Brocot Tree</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/FareySequence.html">Farey Sequence</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Farey_sequence">Farey Sequence</a>.
%e a(5) = 2. F_5 = {0, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1} and the first forward difference is {1/5, 1/20, 1/12, 1/15, 1/10, 1/10, 1/15, 1/12, 1/20, 1/5}. The average distance is 1/10 since A002088(5) = 10 which is also the number of adjacent pairs, a/b & c/d.
%t f[n_] := Block[{diff = Differences@ Union@ Flatten@ Table[a/b, {b, n}, {a, 0, b}], ave = 1/Sum[ EulerPhi[ m], {m, n}]}, {Length@ Select[diff, ave < # &], Length@ Select[diff, ave == # &], Length@ Select[diff, ave > # &]}]; Array[f, 65]
%Y Cf. A002088, A005728, A006843, A262669.
%K nonn
%O 0,3
%A _Robert G. Wilson v_, Nov 09 2015