|
|
A321859
|
|
Number of primes congruent to 3, 5, 6 modulo 7 and <= n minus number of primes congruent to 1, 2, 4 modulo 7 and <= n.
|
|
15
|
|
|
0, -1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,17
|
|
COMMENTS
|
a(n) is the number of primes <= n that are quadratic nonresidues modulo 7 minus the number of primes <= n that are quadratic residues modulo 7.
The first 10000 terms (except for a(2)) are nonnegative. a(p) = 0 for primes p = 3, 11, 211, 3371, 3389, ... The earliest negative term (besides a(2)) is a(48673) = -1. Conjecturally infinitely many terms should be negative.
Please see the comment in A321856 describing "Chebyshev's bias" in the general case.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = -Sum_{primes p<=n} Legendre(p,7) = -Sum_{primes p<=n} Kronecker(-7,p) = -Sum_{primes p<=n} A175629(p).
|
|
EXAMPLE
|
Below 100, there are 10 primes congruent to 1, 2, 4 modulo 7 and 14 primes congruent to 3, 5, 6 modulo 7, so a(100) = 14 - 10 = 4.
|
|
MATHEMATICA
|
Accumulate[Table[Which[PrimeQ[n]&&MemberQ[{3, 5, 6}, Mod[n, 7]], 1, PrimeQ[ n] && MemberQ[ {1, 2, 4}, Mod[ n, 7]], -1, True, 0], {n, 90}]] (* Harvey P. Dale, Apr 28 2022 *)
|
|
PROG
|
(PARI) a(n) = -sum(i=1, n, isprime(i)*kronecker(-7, i))
|
|
CROSSREFS
|
Let d be a fundamental discriminant.
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|