This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A262669 #35 Feb 16 2025 08:33:27 %S A262669 0,0,0,2,2,2,4,6,8,8,12,14,18,18,20,26,28,32,32,40,42,46,48,58,58,66, %T A262669 76,78,84,88,94,100,106,114,120,126,128,142,150,162,166,178,178,194, %U A262669 200,206,214,230,236,246,250,266,274,292,296,312,322,338,344,360,360,388,400,408,416,436 %N A262669 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 less than the average. %C A262669 Because the Farey fractions are symmetrical about 1/2, a(n) is always even. %C A262669 Conjecture: this is a monotonic sequence. For n = 0, 1, 3, 4, 8, 12, 17, 23, 41 & 59, a(n) = a(n+1). %C A262669 If instead the question is when the difference is equal to the average, then the sequence becomes 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, ..., . A262670. %C A262669 Conjecture: Twice the number of pairs less than the average (2*A262669) plus the number of pairs which equal the average (A262670) never exceed the number of pairs which are greater than the average for n greater than 245. %C A262669 f( 1000) = 100972, %C A262669 f( 2000) = 403750, %C A262669 f( 3000) = 908068, %C A262669 f( 4000) = 1614072, %C A262669 f( 5000) = 2522376, %C A262669 f( 6000) = 3631762, %C A262669 f( 7000) = 4943332, %C A262669 f( 8000) = 6456904, %C A262669 f( 9000) = 8171296, %C A262669 f(10000) = 10088132. %D A262669 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 A262669 Robert G. Wilson v, <a href="/A262669/b262669.txt">Table of n, a(n) for n = 0..5000</a> %H A262669 Cut the Knot, <a href="http://www.cut-the-knot.org/blue/Farey.shtml">Farey Series</a>. %H A262669 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 A262669 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/FareySequence.html">Farey Sequence</a>. %H A262669 Wikipedia, <a href="https://en.wikipedia.org/wiki/Farey_sequence">Farey Sequence</a>. %F A262669 a(n) = (n/Pi)^2 + O(n/3*(log(n))^(2/3)*(log(log(n)))^(4/3)), (A. Walfisz 1963). %e A262669 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 A262669 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[#][[1]] &, 65, 0] %Y A262669 Cf. A002088, A005728, A006843, A262670. %K A262669 nonn %O A262669 0,4 %A A262669 _Robert G. Wilson v_, Sep 26 2015