%I #33 Jan 01 2020 22:01:34
%S 2,3,5,7,13,19,43,47,73,103,107,109,113,199,283,467,661,887,1063,1069,
%T 1097,1103,1109,1123,1129,1303,1307,1321,1327,1621,1627,2803,3931,
%U 3947,4273,4289,4297,5867,5869,5881,6373,6379,9439,9473,9479,9497,9551,9859,9931,9949
%N Successive n with minimal relative distance |1-theta(n)/n|, where theta(n) = log(A034386(n)) is Chebyshev's theta function.
%C The first 10000 terms are the same as A108310 (see that sequence for comments). - _Charles R Greathouse IV_, Dec 18 2014
%C This sequence, unlike A108310, is presumably infinite; it is finite if and only if theta(n) = n for some number n.
%H Jean-François Alcover and Charles R Greathouse IV, <a href="/A252398/b252398.txt">Table of n, a(n) for n = 1..5000</a> (first 88 terms from Alcover)
%H Eric Weisstein's MathWorld, <a href="http://mathworld.wolfram.com/ChebyshevFunctions.html">Chebyshev functions</a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Chebyshev_function">Chebyshev function</a>
%e Given that 1 - theta(3)/3 = 1 - log(6)/3 = 0.40..., 1 - theta(4)/4 = 1 - log(6)/4 = 0.55... and 1 - theta(5)/5 = 1 - log(30)/5 = 0.31..., the next term after 3 is 5.
%t (* Adapted from PARI *) Reap[For[record = 2; theta = 0; p = 2, p < 2 * 10^8, p = NextPrime[p], theta = theta + Log[p] //N; d = Abs[1 - theta/p]; If[d < record, record = d; Print[p]; Sow[p]]]][[2, 1]]
%o (PARI) /* Note: This program may fail if you replace 1e6 with a number larger than 1e17, and will certainly fail at some point below 1e316. These large numbers are not remotely feasible at the moment. */
%o r=th=0; forprime(p=2,1e6, th+=log(p); t=th/p; if(t>r, r=t; print1(p", "); if(t>1, warning("theta(n) > n, possible missed terms")))) \\ _Charles R Greathouse IV_, Dec 17 2014
%Y Cf. A016040, A035158, A057872, A083535, A108310, A215013.
%K nonn
%O 1,1
%A _Jean-François Alcover_, Dec 17 2014