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.

Showing 1-10 of 17 results. Next

A066520 Number of primes of the form 4m+3 <= n minus number of primes of the form 4m+1 <= n.

Original entry on oeis.org

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

Views

Author

Sharon Sela (sharonsela(AT)hotmail.com), Jan 05 2002

Keywords

Comments

Although the initial terms are nonnegative, it has been proved that infinitely many terms are negative. The first two are a(26861)=a(26862)=-1. Next there are 3404 values of n in the range 616841 to 633798 with a(n)<0. Then 27218 values in the range 12306137 to 12382326.
Partial sums of A151763. - Reinhard Zumkeller, Feb 06 2014

Crossrefs

Cf. A156749 Sequence showing Chebyshev bias in prime races (mod 4). [From Daniel Forgues, Mar 26 2009]
Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), A320857 (d=-8), A321859 (d=-7), this sequence (d=-4), A321856 (d=-3), A321857 (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), A321864 (d=-7), A038698 (d=-4), A112632 (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

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(n) = A066490(n) - A066339(n).
a(2*n+1) = a(2*n+2) = -A156749(n). - Jonathan Sondow, May 17 2013

Extensions

Edited by Dean Hickerson, Mar 05 2002

A112632 Excess of 3k - 1 primes over 3k + 1 primes, beginning with 2.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 4, 3, 4, 3, 2, 1, 2, 3, 4, 3, 4, 3, 4, 3, 2, 1, 2, 1, 2, 3, 2, 3, 4, 5, 6, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 3, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 3, 4, 5, 4, 5, 4, 5, 6, 7, 6, 5
Offset: 1

Views

Author

Roger Hui, Dec 22 2005

Keywords

Comments

Cumulative sums of A134323, negated. The first negative term is a(23338590792) = -1 for the prime 608981813029. See page 4 of the paper by Granville and Martin. - T. D. Noe, Jan 23 2008 [Corrected by Jianing Song, Nov 24 2018]
See the comment about "Chebyshev's bias" in A321856. - Jianing Song, Nov 24 2018

Examples

			a(1) = 1 because 2 == -1 (mod 3).
a(2) = 1 because 3 == 0 (mod 3) and does not change the counting.
a(3) = 2 because 5 == -1 (mod 3).
a(4) = 1 because 7 == 1 (mod 3).
		

Crossrefs

Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), A320857 (d=-8), A321859 (d=-7), A066520 (d=-4), A321856 (d=-3), A321857 (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), A321864 (d=-7), A038698 (d=-4), this sequence (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • Haskell
    a112632 n = a112632_list !! (n-1)
    a112632_list = scanl1 (+) $ map negate a134323_list
    -- Reinhard Zumkeller, Sep 16 2014
    
  • Mathematica
    a[n_] := a[n] = a[n-1] + If[Mod[Prime[n], 6] == 1, -1, 1]; a[1] = a[2] = 1; Table[a[n], {n, 1, 100}]  (* Jean-François Alcover, Jul 24 2012 *)
    Accumulate[Which[IntegerQ[(#+1)/3],1,IntegerQ[(#-1)/3],-1,True,0]& /@ Prime[ Range[100]]] (* Harvey P. Dale, Jun 06 2013 *)
  • PARI
    a(n) = -sum(i=1, n, kronecker(-3, prime(i))) \\ Jianing Song, Nov 24 2018

Formula

a(n) = -Sum_{primes p<=n} Legendre(prime(i),3) = -Sum_{primes p<=n} Kronecker(-3,prime(i)) = -Sum_{i=1..n} A102283(prime(i)). - Jianing Song, Nov 24 2018

A071838 a(n) = Pi(8,3)(n) + Pi(8,5)(n) - Pi(8,1)(n) - Pi(8,7)(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, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 5, 5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 2, 2, 2
Offset: 1

Views

Author

Benoit Cloitre, Jun 08 2002

Keywords

Comments

a(n) is the number of odd primes <= n that have 2 as a quadratic nonresidue minus the number of primes <= n that have 2 as a quadratic residue. See the comments about "Chebyshev's bias" in A321861. - Jianing Song, Nov 24 2018
Although the initial terms are nonnegative, infinitely many terms should be negative. For which n does a(n) = -1?
The first negative term occurs at a(11100143) = -1. - Jianing Song, Nov 08 2019

Crossrefs

Cf. A091337.
Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), A320857 (d=-8), A321859 (d=-7), A066520 (d=-4), A321856 (d=-3), A321857 (d=5), this sequence (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), A321864 (d=-7), A038698 (d=-4), A112632 (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • Mathematica
    Accumulate@ Array[-If[PrimeQ@ #, KroneckerSymbol[2, #], 0] &, 105] (* Michael De Vlieger, Nov 25 2018 *)
  • PARI
    for(n=1,200,print1(sum(i=1,n,if((i*isprime(i)-3)%8,0,1)+if((i*isprime(i)-5)%8,0,1)-if((i*isprime(i)-1)%8,0,1)-if((i*isprime(i)-7)%8,0,1)),", ")) \\ Program fixed by Jianing Song, Nov 08 2019
    
  • PARI
    a(n) = -sum(i=1, n, isprime(i)*kronecker(2, i)) \\ Jianing Song, Nov 24 2018

Formula

a(n) = -Sum_{primes p<=n} Kronecker(2,p) = -Sum_{primes p<=n} A091337(p). - Jianing Song, Nov 20 2018

Extensions

Edited by Peter Munn, Nov 19 2023

A320857 a(n) = Pi(8,5)(n) + Pi(8,7)(n) - Pi(8,1)(n) - Pi(8,3)(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, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Jianing Song, Nov 24 2018

Keywords

Comments

a(n) is the number of odd primes <= n that have -2 as a quadratic nonresidue minus the number of primes <= n that have -2 as a quadratic residue.
It seems that there are more negative terms here than in some other sequences mentioned in crossrefs; nevertheless, among the first 10000 terms, only 212 ones are negative.
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 18 2023]
Here, although 3 is not a quadratic residue modulo 8, for most n we have Pi(8,5)(n) + Pi(8,7)(n) > Pi(8,1)(n) - Pi(8,3)(n), Pi(8,3)(n) + Pi(8,7)(n) > Pi(8,1)(n) + Pi(8,5)(n) and Pi(8,5)(n) + Pi(8,7)(n) > Pi(8,1)(n) + Pi(8,7)(n).

Examples

			Pi(8,1)(200) = 8, Pi(8,5)(200) = 13, Pi(8,3)(200) = Pi(8,7)(200) = 12, so a(200) = 13 + 12 - 8 - 12 = 5.
		

Crossrefs

Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), this sequence (d=-8), A321859 (d=-7), A066520 (d=-4), A321856 (d=-3), A321857 (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), A321864 (d=-7), A038698 (d=-4), A112632 (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • Mathematica
    Accumulate@ Array[-If[PrimeQ@ #, KroneckerSymbol[-2, #], 0] &, 88] (* Michael De Vlieger, Nov 25 2018 *)
  • PARI
    a(n) = -sum(i=1, n, isprime(i)*kronecker(-2, i))
    
  • Python
    from sympy import isprime; from numpy import sign
    def A320857(n): return sum(isprime(i)*(i%2)*sign(i%8-4) for i in range(1,n+1)) # Ya-Ping Lu, Jan 25 2025

Formula

a(n) = -Sum_{primes p<=n} Kronecker(-2,p) = -Sum_{primes p<=n} A188510(p).

A320858 a(n) = A320857(prime(n)).

Original entry on oeis.org

0, -1, 0, 1, 0, 1, 0, -1, 0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 1, 0, 1, 2, 1, 2, 1, 2, 1, 0, -1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 3, 2, 3, 4, 5, 6, 5, 4, 5, 4, 5, 4, 5, 4, 3, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 5, 4, 5, 6, 5, 6, 5, 4
Offset: 1

Views

Author

Jianing Song, Nov 24 2018

Keywords

Comments

Among the first 10000 terms there are only 100 negative ones. See the comments about "Chebyshev's bias" in A320857.

Examples

			prime(46) = 199, Pi(8,1)(199) = 8, Pi(8,5)(199) = 13, Pi(8,3)(199) = Pi(8,7)(199) = 12, so a(46) = 13 + 12 - 8 - 12 = 5.
		

Crossrefs

Cf. A188510.
Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), A320857 (d=-8), A321859 (d=-7), A066520 (d=-4), A321856 (d=-3), A321857 (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), this sequence (d=-8), A321864 (d=-7), A038698 (d=-4), A112632 (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • Mathematica
    a[n_] := -Sum[KroneckerSymbol[-2, Prime[i]], {i, 1, n}];
    Array[a, 100] (* Jean-François Alcover, Dec 28 2018, from PARI *)
  • PARI
    a(n) = -sum(i=1, n, kronecker(-2, prime(i)))

Formula

a(n) = -Sum_{i=1..n} Kronecker(prime(i),2) = -Sum_{primes p<=n} Kronecker(2,prime(i)) = -Sum_{i=1..n} A091337(prime(i)).

A321857 a(n) = Pi(5,2)(n) + Pi(5,3)(n) - Pi(5,1)(n) - Pi(5,4)(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, 1, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 4, 4, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 4, 4
Offset: 1

Views

Author

Jianing Song, Nov 20 2018

Keywords

Comments

a(n) is the number of primes <= n that are quadratic nonresidues modulo 5 minus the number of primes <= n that are quadratic residues modulo 5.
a(n) is positive for 2 <= n <= 10000, but conjecturally infinitely many terms should be negative.
The first negative term occurs at a(2082927221) = -1. - Jianing Song, Nov 08 2019
Please see the comment in A321856 describing "Chebyshev's bias" in the general case.

Examples

			Pi(5,1)(100) = Pi(5,4)(100) = 5, Pi(5,2)(100) = Pi(5,3)(100) = 7, so a(100) = 7 + 7 - 5 - 5 = 4.
		

Crossrefs

Cf. A080891.
Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), A320857 (d=-8), A321859 (d=-7), A066520 (d=-4), A321856 (d=-3), this sequence (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), A321864 (d=-7), A038698 (d=-4), A112632 (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • PARI
    a(n) = -sum(i=1, n, isprime(i)*kronecker(5, i))

Formula

a(n) = -Sum_{primes p<=n} Legendre(p,5) = -Sum_{primes p<=n} Kronecker(5,p) = -Sum_{primes p<=n} A080891(p).

Extensions

Edited by Peter Munn, Nov 18 2023

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Jianing Song, Nov 20 2018

Keywords

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.

Examples

			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.
		

Crossrefs

Cf. A175629.
Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), A320857 (d=-8), this sequence (d=-7), A066520 (d=-4), A321856 (d=-3), A321857 (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), A321864 (d=-7), A038698 (d=-4), A112632 (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • 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 *)
  • PARI
    a(n) = -sum(i=1, n, isprime(i)*kronecker(-7, i))

Formula

a(n) = -Sum_{primes p<=n} Legendre(p,7) = -Sum_{primes p<=n} Kronecker(-7,p) = -Sum_{primes p<=n} A175629(p).

A321860 Number of primes congruent to 2, 6, 7, 8, 10 modulo 11 and <= n minus number of primes congruent to 1, 3, 4, 5, 9 modulo 11 and <= n.

Original entry on oeis.org

0, 1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Jianing Song, Nov 20 2018

Keywords

Comments

a(n) is the number of primes <= n that are quadratic nonresidues modulo 11 minus the number of primes <= n that are quadratic residues modulo 11.
It seems that there are more negative terms here than in some other sequences mentioned in crossrefs; nevertheless, among the first 10000 terms, only 138 ones are negative.
Please see the comment in A321856 describing "Chebyshev's bias" in the general case.

Examples

			Below 200, there are 20 primes congruent to 1, 3, 4, 5, 9 modulo 11 and 23 primes congruent to 2, 6, 7, 8, 10 modulo 11, so a(200) = 23 - 20 = 3.
		

Crossrefs

Cf. A112632.
Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: this sequence (d=-11), A320857 (d=-8), A321859 (d=-7), A066520 (d=-4), A321856 (d=-3), A321857 (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), A321864 (d=-7), A038698 (d=-4), A112632 (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • PARI
    a(n) = -sum(i=1, n, isprime(i)*kronecker(-11, i))

Formula

a(n) = -Sum_{primes p<=n} Legendre(p,11) = -Sum_{primes p<=n} Kronecker(-11,p) = -Sum_{primes p<=n} A011582(p).

A321862 a(n) = A321857(prime(n)).

Original entry on oeis.org

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

Views

Author

Jianing Song, Nov 20 2018

Keywords

Comments

The first 10000 terms are positive, but conjecturally infinitely many terms should be negative.
The first negative term occurs at a(102091236) = -1. - Jianing Song, Nov 08 2019
Please see the comment in A321856 describing "Chebyshev's bias" in the general case.

Examples

			prime(25) = 97, Pi(5,1)(97) = Pi(5,4)(97) = 5, Pi(5,2)(97) = Pi(5,3)(97) = 7, so a(25) = 7 + 7 - 5 - 5 = 4.
		

Crossrefs

Cf. A080891.
Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), A320857 (d=-8), A321859 (d=-7), A066520 (d=-4), A321856 (d=-3), A321857 (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), A321864 (d=-7), A038698 (d=-4), A112632 (d=-3), this sequence (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • PARI
    a(n) = -sum(i=1, n, kronecker(5, prime(i)))

Formula

a(n) = -Sum_{i=1..n} Legendre(prime(i),5) = -Sum_{primes p<=n} Kronecker(2,prime(i)) = -Sum_{i=1..n} A080891(prime(i)).

Extensions

Edited by Peter Munn, Nov 19 2023

A321864 a(n) = A321859(prime(n)).

Original entry on oeis.org

-1, 0, 1, 1, 0, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 0, 1, 0, 1, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6, 5, 6, 5, 4, 5, 4, 5, 4, 5, 6, 5, 4, 5, 6, 5, 4
Offset: 1

Views

Author

Jianing Song, Nov 20 2018

Keywords

Comments

Among the first 10000 terms there are only 13 negative ones, with the earliest one (besides a(1)) being a(5006) = -1.
Please see the comment in A321856 describing "Chebyshev's bias" in the general case.

Examples

			prime(25) = 97. Among the primes <= 97, there are 10 ones congruent to 1, 2, 4 modulo 7 and 14 ones congruent to 3, 5, 6 modulo 7, so a(25) = 14 - 10 = 4.
		

Crossrefs

Cf. A175629.
Let d be a fundamental discriminant.
Sequences of the form "a(n) = -Sum_{primes p<=n} Kronecker(d,p)" with |d| <= 12: A321860 (d=-11), A320857 (d=-8), A321859 (d=-7), A066520 (d=-4), A321856 (d=-3), A321857 (d=5), A071838 (d=8), A321858 (d=12).
Sequences of the form "a(n) = -Sum_{i=1..n} Kronecker(d,prime(i))" with |d| <= 12: A321865 (d=-11), A320858 (d=-8), this sequence (d=-7), A038698 (d=-4), A112632 (d=-3), A321862 (d=5), A321861 (d=8), A321863 (d=12).

Programs

  • PARI
    a(n) = -sum(i=1, n, kronecker(-7, prime(i)))

Formula

a(n) = -Sum_{primes p<=n} Legendre(prime(i),7) = -Sum_{primes p<=n} Kronecker(-7,prime(i)) = -Sum_{i=1..n} A175629(prime(i)).
Showing 1-10 of 17 results. Next