A066520 Number of primes of the form 4m+3 <= n minus number of primes of the form 4m+1 <= n.
0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 2
Offset: 1
Links
- T. D. Noe, Table of n, a(n) for n=1..30000 (enough terms to show the first dip into negative territory)
- Carter Bays and Richard H. Hudson, Zeros of Dirichlet L-Functions and Irregularities in the Distribution of Primes, Mathematics of Computation, 69 (2000) 861-866.
- A. Granville and G. Martin, Prime number races, arXiv:math/0408319 [math.NT], 2004.
Crossrefs
Cf. A156749 Sequence showing Chebyshev bias in prime races (mod 4). [From Daniel Forgues, Mar 26 2009]
Let d be a fundamental discriminant.
Programs
-
Haskell
a066520 n = a066520_list !! (n-1) a066520_list = scanl1 (+) $ map (negate . a151763) [1..] -- Reinhard Zumkeller, Feb 06 2014
-
Mathematica
a[n_] := Length[Select[Range[3, n, 4], PrimeQ]]-Length[Select[Range[1, n, 4], PrimeQ]] f[n_]:=Module[{c=Mod[n,4]},Which[!PrimeQ[n],0,c==3,1,c==1,-1]]; Join[{0,0}, Accumulate[Array[f,110,3]]] (* Harvey P. Dale, Mar 03 2013 *)
Formula
a(2*n+1) = a(2*n+2) = -A156749(n). - Jonathan Sondow, May 17 2013
Extensions
Edited by Dean Hickerson, Mar 05 2002
Comments