login
Let F_n(k) be the k-th term of the n-th Farey sequence and define s_n = Sum_{i=1..m} |F_n(i) - i/m| where m is the length of the n-th Farey sequence. Then a(n) is the least k such that s_k >= n.
0

%I #21 Jan 14 2023 13:20:22

%S 1,19,83,195,442,663,1106,2215,2769,2803,5613,8411,8554,9833,15801

%N Let F_n(k) be the k-th term of the n-th Farey sequence and define s_n = Sum_{i=1..m} |F_n(i) - i/m| where m is the length of the n-th Farey sequence. Then a(n) is the least k such that s_k >= n.

%C 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.

%H Edmund Landau, <a href="http://www.digizeitschriften.de/dms/img/?PID=GDZPPN002506548">Bemerkungen zu der vorstehenden Abhandlung von Herrn Franel</a> (in German), Nachrichten von der Gesellschaft der Wissenschaften zu Göttingen. Mathematisch-Physikalische Klasse (1924), pp. 202-206.

%H <a href="/index/Fa#Farey">Index entries for sequences related to Farey series or tree or fractions</a>

%e The first Farey sequence is (0, 1) and |0 - 1/2| + |1 - 1| = 1/2 + 0 = 1/2 > 0, so a(0) = 1.

%e 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.

%o (PARI) step(x,y,n)=my(b=denominator(x),d=denominator(y),z=(n+b)\d);(z*numerator(y)-numerator(x))/(z*d-b)

%o 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)

%o Fsum(n)=my(F=Farey(n),m=#F); sum(i=1,m,abs(F[i]-i/m),0.)

%o a(n,startAt=1)=for(k=startAt,oo, if(Fsum(k)>=n, return(k)))

%o (PARI) A002088(n)=my(s=1); forsquarefree(k=1, n, s+=(n\k[1])^2*moebius(k)); s\2

%o step(x,y,n)=my(b=denominator(x),d=denominator(y),z=(n+b)\d);(z*numerator(y)-numerator(x))/(z*d-b)

%o 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

%o 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])))

%K nonn,hard,more

%O 0,2

%A _Charles R Greathouse IV_, Mar 23 2022

%E a(15) from _Charles R Greathouse IV_, Apr 08 2022