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 13 results. Next

A007350 Where the prime race 4k-1 vs. 4k+1 changes leader.

Original entry on oeis.org

3, 26861, 26879, 616841, 617039, 617269, 617471, 617521, 617587, 617689, 617723, 622813, 623387, 623401, 623851, 623933, 624031, 624097, 624191, 624241, 624259, 626929, 626963, 627353, 627391, 627449, 627511, 627733, 627919, 628013, 628427, 628937, 629371
Offset: 1

Views

Author

Keywords

Comments

The following references include some on the "prime race" question that are not necessarily related to this particular sequence. - N. J. A. Sloane, May 22 2006
Starting from a(12502) = A051025(27556) = 9103362505801, the sequence includes the 8th sign-changing zone predicted by C. Bays et al. The sequence with the first 8 sign-changing zones contains 194367 terms (see a-file) with a(194367) = 9543313015387 as its last term. - Sergei D. Shchebetov, Oct 13 2017

References

  • Ford, Kevin; Konyagin, Sergei; Chebyshev's conjecture and the prime number race. IV International Conference "Modern Problems of Number Theory and its Applications": Current Problems, Part II (Russian) (Tula, 2001), 67-91.
  • Granville, Andrew; Martin, Greg; Prime number races. (Spanish) With appendices by Giuliana Davidoff and Michael Guy. Gac. R. Soc. Mat. Esp. 8 (2005), no. 1, 197-240.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A156749 [sequence showing Chebyshev bias in prime races (mod 4)]. - Daniel Forgues, Mar 26 2009

Programs

  • Mathematica
    lim = 10^5; k1 = 0; k3 = 0; t = Table[{p = Prime[k], If[Mod[p, 4] == 1, ++k1, k1], If[Mod[p, 4] == 3, ++k3, k3]}, {k, 2, lim}]; A007350 = {3}; Do[ If[t[[k-1, 2]] < t[[k-1, 3]] && t[[k, 2]] == t[[k, 3]] && t[[k+1, 2]] > t[[k+1, 3]] || t[[k-1, 2]] > t[[k-1, 3]] && t[[k, 2]] == t[[k, 3]] && t[[k+1, 2]] < t[[k+1, 3]], AppendTo[A007350, t[[k+1, 1]]]], {k, 2, Length[t]-1}]; A007350 (* Jean-François Alcover, Sep 07 2011 *)
    lim = 10^5; k1 = 0; k3 = 0; p = 2; t = {}; parity = Mod[p, 4]; Do[p = NextPrime[p]; If[Mod[p, 4] == 1, k1++, k3++]; If[(k1 - k3)*(parity - Mod[p, 4]) > 0, AppendTo[t, p]; parity = Mod[p, 4]], {lim}]; t (* T. D. Noe, Sep 07 2011 *)

A038698 Excess of 4k-1 primes over 4k+1 primes, beginning with prime 2.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(n) < 0 for infinitely many values of n. - Benoit Cloitre, Jun 24 2002
First negative value is a(2946) = -1, which is for prime 26861. - David W. Wilson, Sep 27 2002

References

  • Stan Wagon, The Power of Visualization, Front Range Press, 1994, p. 2.

Crossrefs

Cf. A112632 (race of 3k-1 and 3k+1 primes), A216057, A269364.
Cf. A156749 (sequence showing Chebyshev bias in prime races (mod 4)), A199547, A267097, A267098, A267107, A292378.
List of primes p such that a(p) = 0 is A007351. List of primes p such that a(p) < 0 is A199547. List of primes p such that a(p) = -1 is A051025. List of integers k such that a(prime(k)) = -1 is A051024. - Ya-Ping Lu, Jan 18 2025

Programs

  • Maple
    ans:=[0]; ct:=0; for n from 2 to 2000 do
    p:=ithprime(n); if (p mod 4) = 3 then ct:=ct+1; else ct:=ct-1; fi;
    ans:=[op(ans),ct]; od: ans; # N. J. A. Sloane, Jun 24 2016
  • Mathematica
    FoldList[Plus, 0, Mod[Prime[Range[2,110]], 4] - 2]
    Join[{0},Accumulate[If[Mod[#,4]==3,1,-1]&/@Prime[Range[2,110]]]] (* Harvey P. Dale, Apr 27 2013 *)
  • PARI
    for(n=2,100,print1(sum(i=2,n,(-1)^((prime(i)+1)/2)),","))
    
  • Python
    from sympy import nextprime; a, p = 0, 2; R = [a]
    for _ in range(2,88): p=nextprime(p); a += p%4-2; R.append(a)
    print(*R, sep = ', ')  # Ya-Ping Lu, Jan 18 2025

Formula

a(n) = Sum_{k=2..n} (-1)^((prime(k)+1)/2). - Benoit Cloitre, Jun 24 2002
a(n) = (Sum_{k=1..n} prime(k) mod 4) - 2*n (assuming that x mod 4 > 0). - Thomas Ordowski, Sep 21 2012
From Antti Karttunen, Oct 01 2017: (Start)
a(n) = A267098(n) - A267097(n).
a(n) = A292378(A000040(n)).
(End)
From Ridouane Oudra, Nov 04 2024: (Start)
a(n) = Sum_{k=2..n} i^(prime(k)+1), where i is the imaginary unit.
a(n) = Sum_{k=2..n} sin(3*prime(k)*Pi/2).
a(n) = Sum_{k=2..n} A163805(prime(k)).
a(n) = Sum_{k=2..n} A212159(k). (End)
a(n) = a(n-1) + prime(n) (mod 4) - 2, n >= 2. - Ya-Ping Lu, Jan 18 2025

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

A038691 Indices of primes at which the prime race 4k-1 vs. 4k+1 is tied.

Original entry on oeis.org

1, 3, 7, 13, 89, 2943, 2945, 2947, 2949, 2951, 2953, 50371, 50375, 50377, 50379, 50381, 50393, 50413, 50423, 50425, 50427, 50429, 50431, 50433, 50435, 50437, 50439, 50445, 50449, 50451, 50503, 50507, 50515, 50517, 50821, 50843, 50853, 50855, 50857, 50859, 50861
Offset: 1

Views

Author

Keywords

Comments

Starting from a(27410) = 316064952537 the sequence includes the 8th sign-changing zone predicted by C. Bays et al back in 2001. The sequence with the first 8 sign-changing zones contains 419467 terms (see a-file) with a(419467) = 330797040309 as its last term. - Sergei D. Shchebetov, Oct 16 2017

Examples

			From _Jon E. Schoenfield_, Jul 24 2021: (Start)
a(n) is the n-th number m at which the prime race 4k-1 vs. 4k+1 is tied:
.
                             count
                           ----------
   m  p=prime(m)  p mod 4  4k-1  4k+1
  --  ----------  -------  ----  ----
   1       2         2       0  =  0    a(1)=1
   2       3        -1       1     0
   3       5        +1       1  =  1    a(2)=3
   4       7        -1       2     1
   5      11        -1       3     1
   6      13        +1       3     2
   7      17        +1       3  =  3    a(3)=7
   8      19        -1       4     3
   9      23        -1       5     3
  10      29        +1       5     4
  11      31        -1       6     4
  12      37        +1       6     5
  13      41        +1       6  =  6    a(4)=13
(End)
		

References

  • Stan Wagon, The Power of Visualization, Front Range Press, 1994, pp. 2-3.

Crossrefs

Cf. A156749; sequence showing Chebyshev bias in prime races (mod 4). - Daniel Forgues, Mar 26 2009

Programs

  • Mathematica
    Flatten[ Position[ FoldList[ Plus, 0, Mod[ Prime[ Range[ 2, 50900 ] ], 4 ]-2 ], 0 ] ]
  • PARI
    lista(nn) = {nbp = 0; nbm = 0; forprime(p=2, nn, if (((p-1) % 4) == 0, nbp++, if (((p+1) % 4) == 0, nbm++)); if (nbm == nbp, print1(primepi(p), ", ")););} \\ Michel Marcus, Nov 20 2016

A096628 Integers k for which {prime(1), prime(2), ..., prime(k)} (mod 4) is biased towards 1.

Original entry on oeis.org

2946, 50378, 50380, 50382, 50383, 50384, 50385, 50386, 50387, 50388, 50389, 50390, 50391, 50392, 50414, 50415, 50416, 50417, 50418, 50419, 50420, 50421, 50422, 50424, 50426, 50428, 50430, 50436, 50438, 50446, 50447, 50448, 50450
Offset: 1

Views

Author

Eric W. Weisstein, Jul 01 2004

Keywords

Comments

Indices of negative terms in A038698. - Jianing Song, Feb 20 2019

Crossrefs

Programs

  • Maple
    R:= NULL: count:= 0: v:= 0: p:= 2:
    for i from 2 while count < 100 do
      p:= nextprime(p);
      if p mod 4 = 3 then v:= v+1
      else v:= v-1
      fi;
      if v < 0 then R:= R,i; count:= count+1 fi
    od:
    R; # Robert Israel, Apr 17 2023

A199547 Primes p for which pi_{4,3}(p) < pi_{4,1}(p), where pi_{m,a}(x) is the number of primes <= x which are congruent to a (mod m).

Original entry on oeis.org

26861, 616841, 616849, 616877, 616897, 616909, 616933, 616943, 616951, 616961, 616991, 616997, 616999, 617011, 617269, 617273, 617293, 617311, 617327, 617333, 617339, 617341, 617359, 617369, 617401, 617429, 617453, 617521, 617537, 617689, 617693, 617699, 617717
Offset: 1

Views

Author

Arkadiusz Wesolowski, Dec 09 2011

Keywords

Comments

Another version of A007350.
J. E. Littlewood (1914) proved that this sequence is infinite.
a(1) = 26861 was found in 1957 by John Leech.
Prime indices of negative terms in A066520. - Jianing Song, Feb 20 2019

References

  • Wacław Sierpiński, O stu prostych, ale trudnych zagadnieniach arytmetyki. Warsaw: PZWS, 1959, p. 22.

Crossrefs

Programs

  • Mathematica
    lst = {}; For[n = 2; t = 0, n < 50451, n++, t += Mod[p = Prime[n], 4] - 2; If[t < 0, AppendTo[lst, p]]]; lst
  • Python
    from sympy import nextprime; a, p = 0, 2
    while p < 617717:
        p=nextprime(p); a += p%4-2
        if a < 0: print(p, end = ', ') # Ya-Ping Lu, Jan 18 2025

Formula

a(n) = prime(A096628(n)). - Jianing Song, Feb 20 2019

A051025 Primes p for which pi_{4,3}(p) - pi_{4,1}(p) = -1, where pi_{m,a}(x) is the number of primes <= x which are congruent to a (mod m).

Original entry on oeis.org

26861, 616841, 616849, 616877, 617011, 617269, 617327, 617339, 617359, 617369, 617401, 617429, 617453, 617521, 617537, 617689, 617699, 617717, 622813, 622987, 623003, 623107, 623209, 623299, 623321, 623341, 623353, 623401, 623423, 623437
Offset: 1

Views

Author

Keywords

Comments

This is a companion sequence to A051024.
Starting from a(27556)=9103362505801 the sequence includes the 8th sign-changing zone predicted by C. Bays et al. The sequence with the first 8 sign-changing zones contains 418933 terms (see a-file) with a(418933)=9543313015309 as its last term. - Sergei D. Shchebetov, Oct 06 2017
We also discovered the 9th sign-changing zone, which starts from 64083080712569, ends with 64084318523021, and has 13370 terms with pi_{4,3}(p) - pi_{4,1}(p) = -1. This zone is considerably lower than predicted by M. Deléglise et al. in 2004. - Andrey S. Shchebetov and Sergei D. Shchebetov, Dec 30 2017
We also discovered the 10th sign-changing zone, which starts from 715725135905981, ends with 732156384107921, and has 481194 terms with pi_{4,3}(p) - pi_{4,1}(p) = -1. This zone is considerably lower than predicted by M. Deléglise et al. in 2004. - Andrey S. Shchebetov and Sergei D. Shchebetov, Jan 28 2018

Crossrefs

Cf. A156749 Sequence showing Chebyshev bias in prime races (mod 4). - Daniel Forgues, Mar 26 2009

Programs

  • Mathematica
    For[i=2; d=0, True, i++, d+=Mod[p=Prime[i], 4]-2; If[d==-1, Print[p]]]
    (* Second program: *)
    Prime@ Position[Accumulate@ Array[Mod[Prime@ #, 4] - 2 &, 51000], -1][[All, 1]] (* Michael De Vlieger, Dec 30 2017 *)
  • Python
    from sympy import nextprime; a, p = 0, 2
    while p < 623803:
        p=nextprime(p); a += p%4-2
        if a == -1: print(p, end = ', ')  # Ya-Ping Lu, Jan 18 2025

Extensions

Edited by Dean Hickerson, Mar 10 2002

A297447 Values of n for which pi_{8,5}(p_n) - pi_{8,1}(p_n) = -1, where p_n is the n-th prime and pi_{m,a}(x) is the number of primes <= x which are congruent to a (mod m).

Original entry on oeis.org

30733704, 30733708, 30733714, 30733726, 30733729, 30733733, 30733743, 30733762, 30733764, 30733777, 30733781, 30733796, 30733853, 30733857, 30733860, 30733866, 30733880, 30733887, 30733890, 30734262
Offset: 1

Views

Author

Andrey S. Shchebetov and Sergei D. Shchebetov, Dec 30 2017

Keywords

Comments

This is a companion sequence to A297448. The first two sign-changing zones were discovered by Bays and Hudson back in 1979. We discovered four additional zones starting from a(22794) = 186422420112. The full sequence with all 6 zones checked up to 5*10^14 contains 664175 terms (see a-file) with a(664175) = 6097827689926 as its last term.
This sequence was checked up to 10^15 and the 7th sign-changing zone starting from a(664176) = 27830993289634 and ending with a(850232)= 27876113171315 was found. - Andrey S. Shchebetov and Sergei D. Shchebetov, Jul 28 2018
The y-coordinate of prime(a(n)) on the Cartesian grid defined in A379643 is -1. - Ya-Ping Lu, Jan 08 2025

Crossrefs

Programs

  • Python
    from sympy import nextprime; p, r1, r5 = 1, 0, 0
    for n in range(1, 30734263):
        p = nextprime(p); r = p%8
        if r == 1: r1 += 1
        elif r == 5: r5 += 1
    if r in {1, 5} and r1 == r5 + 1: print(n, end = ', ')  # Ya-Ping Lu, Jan 08 2025

A295354 Primes p for which pi_{8,7}(p) - pi_{8,1}(p) = -1, where pi_{m,a}(x) is the number of primes <= x which are congruent to a (mod m).

Original entry on oeis.org

192252423729713, 192252423730849, 192252423731231, 192252423731633, 192252423731663, 192252423731839, 192252423732311, 192252423769201, 192252423769361, 192252423769537, 192252423772649, 192252423772807, 192252423772847, 192252423774023, 192252423774079, 192252423774457, 192252423779257, 192252423782521, 192252423783263, 192252423783551
Offset: 1

Views

Author

Andrey S. Shchebetov and Sergei D. Shchebetov, Nov 20 2017

Keywords

Comments

This sequence is a companion sequence to A295353. The sequence with the first found pi_{8,7}(p_n) - pi_{8,1}(p_n) sign-changing zone contains 234937 terms (see a-file) with a(237937) = 192876135747311 as its last term. In addition, a(1) = A275939(8).

Crossrefs

A295353 Values of n for which pi_{8,7}(p_n) - pi_{8,1}(p_n) = -1, where p_n is the n-th prime and pi_{m,a}(x) is the number of primes <= x which are congruent to a (mod m).

Original entry on oeis.org

6035005477560, 6035005477596, 6035005477608, 6035005477618, 6035005477620, 6035005477623, 6035005477632, 6035005478719, 6035005478725, 6035005478730, 6035005478822, 6035005478826, 6035005478829, 6035005478863, 6035005478866, 6035005478874, 6035005479026, 6035005479132, 6035005479158, 6035005479163
Offset: 1

Views

Author

Andrey S. Shchebetov and Sergei D. Shchebetov, Nov 20 2017

Keywords

Comments

This sequence is a companion sequence to A295354. The sequence with the first found pi_{8,7}(p_n) - pi_{8,1}(p_n) sign-changing zone contains 234937 terms (see a-file) with a(237937) = 6053968231350 as its last term.

Crossrefs

Showing 1-10 of 13 results. Next