OFFSET
0,4
COMMENTS
Because the Farey fractions are symmetrical about 1/2, a(n) is always even.
Conjecture: this is a monotonic sequence. For n = 0, 1, 3, 4, 8, 12, 17, 23, 41 & 59, a(n) = a(n+1).
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.
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.
f( 1000) = 100972,
f( 2000) = 403750,
f( 3000) = 908068,
f( 4000) = 1614072,
f( 5000) = 2522376,
f( 6000) = 3631762,
f( 7000) = 4943332,
f( 8000) = 6456904,
f( 9000) = 8171296,
f(10000) = 10088132.
REFERENCES
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.
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..5000
Cut the Knot, Farey Series.
The University of Surrey, Math Dept., Fractions in the Farey Series and the Stern-Brocot Tree.
Eric Weisstein's World of Mathematics, Farey Sequence.
Wikipedia, Farey Sequence.
FORMULA
a(n) = (n/Pi)^2 + O(n/3*(log(n))^(2/3)*(log(log(n)))^(4/3)), (A. Walfisz 1963).
EXAMPLE
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.
MATHEMATICA
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]
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Sep 26 2015
STATUS
approved