OFFSET
1,4
COMMENTS
The first element of each row is 0 (because the distance from any element to itself is 0), the last element of each row is 1 (because the distance from 0 to 1 is 1). These give denominators of 1 and 1.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
Table begins:
0, 1;
0, 1/2, 1;
0, 1/6, 1/3, 2/3, 1;
0, 1/12, 1/4, 5/12, 1/2, 3/4, 1;
Consider the third row. The Farey series for 3 is (0, 1/3, 1/2, 2/3, 1). 0 is always first. The closest two elements are 1/3 and 1/2, so 1/6 is next. The closest three are 1/3 and 2/3 with distance 1/3. Including either endpoint gives distance 2/3; both gives distance 1.
PROG
(PARI) Farey(n)=my(v=List([0, 1])); for(a=2, n, for(b=1, a-1, listput(v, b/a))); vecsort(Vec(v), , 8)
f(n)=my(F=Farey(n)); vector(#F, k, my(b=1); for(i=k, #F, b=min(F[i]-F[i-k+1], b)); b)
for(n=1, 9, v=apply(denominator, f(n)); for(i=1, #v, print1(v[i]", ")))
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Charles R Greathouse IV, Jun 15 2013
STATUS
approved