OFFSET
1,5
COMMENTS
In general, assuming the strong form of the Riemann Hypothesis, if 0 < a, b < k are integers, gcd(a, k) = gcd(b, k) = 1, a is a quadratic residue and b is a quadratic nonresidue mod k, then Pi(k,b)(n) > Pi(k,a)(n) occurs more often than not. This phenomenon is called "Chebyshev's bias". (See Wikipedia link and especially the links in A007350.) [Edited by Peter Munn, Nov 19 2023]
Define the "Chebyshev's bias sequence mod k" to be sequence q(n), where q(n) = Sum_{b is a quadratic nonresidue mod k, gcd(b, k) = 1} Pi(k,b)(n) - (r-1)*(Sum_{a is a quadratic residue mod k, gcd(a, k) = 1} Pi(k,a)(n)), r is the number of solutions to x^2 == 1 (mod n), then this sequence is the "Chebyshev's bias sequence mod 8". Also the initial terms are nonnegative integers, a(n) is negative for some n ~ 10^28.127. See page 21 of the paper in Journal of Number Theory in the Links section below.
LINKS
Jianing Song, Table of n, a(n) for n = 1..10000
Bays, Carter & Ford, Kevin & Hudson, Richard & Rubinstein, Michael, Zeros of Dirichlet L-functions near the Real Axis and Chebyshev's Bias. Journal of Number Theory, Vol. 87, Issue 1, Mar 2001, pp. 54-76.
Andrew Granville and Greg Martin, Prime number races, Amer. Math. Monthly, 113 (No. 1, 2006), 1-33.
EXAMPLE
Below 2000000, there are 37116 primes congruent to 1 mod 8, 37261 primes congruent to 3 mod 8, 37300 primes congruent to 5 mod 8 and 37255 primes congruent to 7 mod 8, so a(2000000) = 37261 + 37300 + 37255 - 3*37116 = 468.
PROG
(PARI) a(n) = my(k=0); for(p=1, n, if(isprime(p)&&p>2, if(p%8==1, k-=3, k++))); k
CROSSREFS
KEYWORD
sign
AUTHOR
Jianing Song, Nov 08 2019
STATUS
approved