OFFSET
1,1
COMMENTS
Let D be a fundamental discriminant (only the case where D is fundamental is considered because {Kronecker(D,k)} forms a primitive real Dirichlet character with period |D| if and only if D is fundamental), it seems that Sum_{primes q <= p} Kronecker(D,p) <= 0 occurs much more often than its opposite does. This can be seen as a variation of the well-known "Chebyshev's bias". Sequence gives the least prime that violates the inequality when D runs through all positive discriminants.
For any D, the primes p such that Kronecker(D,p) = 1 has asymptotic density 1/2 in all the primes, so a(n) should be > 0 for all n.
Actually, for most n, a(n) is relatively small compared with A003658(n). There are only 52 n's in [1, 3044] (there are 3044 terms in A003658 below 10000) such that a(n) > A003658(n). The largest terms among the 52 corresponding terms are a(2) = 2082927221 (with A003658(2) = 5), a(2193) = 718010179 (with A003658(2193) = 7213) and a(3) = 11100143 (with A003658(3) = 8).
LINKS
Jianing Song, Table of n, a(n) for n = 1..3044
Wikipedia, Chebyshev's bias
FORMULA
EXAMPLE
Let D = A003658(16) = 53, j(k) = Sum_{primes q <= prime(k)} Kronecker(D,q).
For k = 1, Kronecker(53,2) = -1, so j(1) = -1;
For k = 2, Kronecker(53,3) = -1, so j(2) = -2;
For k = 3, Kronecker(53,5) = -1, so j(3) = -3;
For k = 4, Kronecker(53,7) = +1, so j(4) = -2;
For k = 5, Kronecker(53,11) = +1, so j(5) = -1;
For k = 6, Kronecker(53,13) = +1, so j(6) = 0;
For k = 7, Kronecker(53,17) = +1, so j(7) = 1.
The first time for j > 0 occurs at the prime 17, so a(16) = 17.
PROG
(PARI) b(n) = my(i=0); forprime(p=2, oo, i+=kronecker(n, p); if(i>0, return(p)))
for(n=1, 300, if(isfundamental(n), print1(b(n), ", ")))
(Sage)
def KroneckerSum():
yield 2
ind = 0
while True:
ind += 1
while not is_fundamental_discriminant(ind):
ind += 1
s, p = 0, 1
while s < 1:
p = p.next_prime()
s += kronecker(ind, p)
yield p
A306499 = KroneckerSum()
print([next(A306499) for _ in range(71)]) # Peter Luschny, Feb 26 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Feb 19 2019
STATUS
approved