%I #79 Nov 14 2021 15:11:02
%S 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,3,4,4,5,5,
%T 5,5,5,6,6,6,7,7,7,8,8,8,8,8,9,10,10,10,11,11,11,11,12,12,12,13,14,14,
%U 14,14,14,15,15,16,16,17,17,17,18,18,18,19,19,20,20,21,21,21,22,22,23,23,23,24,25,25,25,25,26,26,27,28,28,28,29,29
%N Number of Riemann zeta function zeros on the critical line, less than n.
%C This sequence is just the cumulative distribution of the zeros.
%C Apart from differing singularities, the beginning of this sequence agrees with the zeta zero counting functions (RiemannSiegelTheta(n) + im(log(zeta(1/2 + i*n))))/Pi + 1 and (sign(im(zeta(1/2 + i*n))) - 1)/2 + floor(n/(2*Pi)*log(n/(2*Pi*e)) + 7/8) + 1, but disagrees later. The first deviations are seen in the continuous counting function at locations of zeta zeros with indices A153815. See also A282793 and A282794. - _Mats Granvik_, Feb 21 2017
%D H. M. Edwards, Riemann's Zeta Function, Dover Publications, New York, 1974 (ISBN 978-0-486-41740-0)
%H T. D. Noe, <a href="/A135297/b135297.txt">Table of n, a(n) for n = 1..10000</a>
%H Mats Granvik, <a href="http://math.stackexchange.com/q/2136668/8530">Mathematics Stackexchange</a>
%H Andrew Guinand, <a href="http://www.archive.org/stream/proceedingsofthe032881mbp#page/n115/mode/2up">A summation formula in the theory of prime numbers, page 111</a>
%H Andrew Guinand, <a href="https://doi.org/10.1112/plms/s2-50.2.107">A summation formula in the theory of prime numbers</a>, Proc. London Math. Soc. (1948) s2-50 (1): 107-119, see page 111.
%H Raymond Manzoni, <a href="http://math.stackexchange.com/a/442686/8530">Riemann Zeta function - number of zeros</a>, Mathematics Stackexchange, 2013.
%H Eric W. Weisstein, <a href="http://mathworld.wolfram.com/RiemannZetaFunctionZeros.html">MathWorld: Riemann Zeta Function Zeros</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Riemann_zeta_function">Riemann Zeta Function</a>
%H <a href="/index/Z#zeta_function">Index entries for sequences related to zeta function</a>
%F a(n) ~ n log (n/(2*Pi*e)) / (2*Pi). - _Charles R Greathouse IV_, Mar 11 2011, corrected by _Hal M. Switkay_, Oct 03 2021
%F From _Mats Granvik_, May 13 2017: (Start)
%F a(n) ~ im(LogGamma(1/4 + i*n/2))/Pi - n/(2*Pi)*log(Pi) + im(log(zeta(1/2 + i*n)))/Pi + 1.
%F a(n) ~ floor(im(LogGamma(1/4 + i*n/2))/Pi - n/(2*Pi)*log(Pi) + 1) + (sign(im(zeta (1/2 + i*n))) - 1)/2 + 1.
%F a(n) ~ (RiemannSiegelTheta(n) + im(log(zeta(1/2 + i*n))))/Pi + 1.
%F a(n) ~ (floor(RiemannSiegelTheta(n)/Pi + 1)) + (sign(im(zeta(1/2 + i*n))) - 1)/2 + 1.
%F a(n) ~ n/(2*Pi)*log(n/(2*Pi*e)) + 7/8 + (im(log(zeta(1/2 + i*n))))/Pi - 1 - O(n^(-1)) + 1.
%F a(n) ~ floor(n/(2*Pi)*log(n/(2*Pi*e)) + 7/8) + (sign(im(zeta(1/2 + i*n))) - 1)/2 + 1.
%F See A286707 for exact relations.
%F (End)
%e The first nontrivial zero is 1/2 + 14.1347...*i; hence, a(15)=1.
%t nn = 100; t = Table[0, {nn}]; k = 1; While[z = Im[ZetaZero[k]]; z < nn, k++; t[[Ceiling[z] ;; nn]]++]
%t With[{zz=Ceiling[Im[N[ZetaZero[Range[30]]]]]},Table[If[MemberQ[zz,n],1,0],{n,Max[zz]}]]//Accumulate (* _Harvey P. Dale_, Aug 15 2017 *)
%o (Sage)
%o # This function makes sure no zeros are missed.
%o def A135297_list(n):
%o Z = lcalc.zeros(n)
%o R = []; pos = 1; count = 0
%o for z in Z:
%o while pos < z:
%o R.append(count)
%o pos += 1
%o count += 1
%o return R
%o A135297_list(30) # _Peter Luschny_, May 02 2014
%o (PARI) a(n) = #lfunzeros(L, n) \\ _Felix Fröhlich_, Jun 10 2019
%Y Cf. A002410, A013629, A092783.
%K nonn
%O 1,22
%A _Jean-François Alcover_, Mar 09 2011