OFFSET
0,2
COMMENTS
Landau proves that s_k = O(k^(1/2 + e)) for all e > 0 is equivalent to the Riemann hypothesis, and hence so is a(n) >> n^(2 - e) for all e > 0.
LINKS
Edmund Landau, Bemerkungen zu der vorstehenden Abhandlung von Herrn Franel (in German), Nachrichten von der Gesellschaft der Wissenschaften zu Göttingen. Mathematisch-Physikalische Klasse (1924), pp. 202-206.
EXAMPLE
The first Farey sequence is (0, 1) and |0 - 1/2| + |1 - 1| = 1/2 + 0 = 1/2 > 0, so a(0) = 1.
The 19th Farey sequence yields the sum |0 - 1/121| + |1/19 - 2/121| + ... + |1 - 1| = 1.04..., and no smaller Farey sequence yields a value 1 or larger, so a(1) = 19.
PROG
(PARI) step(x, y, n)=my(b=denominator(x), d=denominator(y), z=(n+b)\d); (z*numerator(y)-numerator(x))/(z*d-b)
Farey(n)=if(n==1, return([0, 1])); my(v=List([0, 1/n]), t); while(v[#v]<1/2, listput(v, step(v[#v-1], v[#v], n))); t=#v; while(t>1, listput(v, 1-v[t--])); Vec(v)
Fsum(n)=my(F=Farey(n), m=#F); sum(i=1, m, abs(F[i]-i/m), 0.)
a(n, startAt=1)=for(k=startAt, oo, if(Fsum(k)>=n, return(k)))
(PARI) A002088(n)=my(s=1); forsquarefree(k=1, n, s+=(n\k[1])^2*moebius(k)); s\2
step(x, y, n)=my(b=denominator(x), d=denominator(y), z=(n+b)\d); (z*numerator(y)-numerator(x))/(z*d-b)
Fsum(n, sz=A002088(n)+1)=my(x=0, y=1/n, s=abs(2/sz-y)+1/sz, t, k=2.); while(y<1, t=step(x, y, n); s+=abs(k++/sz-t); x=y; y=t); s
a(n, startAt=1)=my(sz=A002088(startAt-1)+1); forfactored(k=startAt, 9! /* oo not legal here, choose a big number instead */, sz+=eulerphi(k); if(Fsum(k[1], sz)>=n, return(k[1])))
CROSSREFS
KEYWORD
nonn,hard
AUTHOR
Charles R Greathouse IV, Mar 23 2022
EXTENSIONS
a(15) from Charles R Greathouse IV, Apr 08 2022
STATUS
proposed