cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A329242 a(n) = Pi(8,3)(n) + Pi(8,5)(n) + Pi(8,7)(n) - 3*Pi(8,1)(n), where Pi(a,b)(x) denotes the number of primes in the arithmetic progression a*k + b less than or equal to x.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10
Offset: 1

Views

Author

Jianing Song, Nov 08 2019

Keywords

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.

Examples

			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.
		

Crossrefs

"Chebyshev's bias sequence mod k": A112632 (k=3), A038698 (k=4), A321862 (k=5), A321864 (k=7), A321865 (k=11).

Programs

  • PARI
    a(n) = my(k=0); for(p=1, n, if(isprime(p)&&p>2, if(p%8==1, k-=3, k++))); k