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.

A007351 Where prime race 4m-1 vs. 4m+1 is tied.

Original entry on oeis.org

2, 5, 17, 41, 461, 26833, 26849, 26863, 26881, 26893, 26921, 616769, 616793, 616829, 616843, 616871, 617027, 617257, 617363, 617387, 617411, 617447, 617467, 617473, 617509, 617531, 617579, 617681, 617707, 617719, 618437, 618521, 618593, 618637
Offset: 1

Views

Author

Keywords

Comments

Primes p such that the number of primes <= p of the form 4m-1 is equal to the number of primes <= p of the form 4m+1.
Starting from a(27410)=9103362505753 the sequence includes the 8th sign-changing zone predicted by C. Bays et al. The sequence with the first 8 sign-changing zones contains 419467 terms (see a-file) with a(419467)=9543313015351 as its last term. - Sergei D. Shchebetov, Oct 15 2017

References

  • 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). [From Daniel Forgues, Mar 26 2009]

Programs

  • Mathematica
    Prime@ Position[Fold[Append[#1, #1[[-1]] + If[Mod[#2, 4] == 3, {1, 0}, {0, 1}]] &, {{0, 0}}, Prime@ Range[2, 10^5]], ?(SameQ @@ # &)][[All, 1]] (* _Michael De Vlieger, May 27 2018 *)
  • PARI
    lista(nn) = {nb = 0; forprime(p=2, nn, m = (p % 4); if (m == 1, nb++, if (m == 3, nb--)); if (!nb, print1(p, ", ")););} \\ Michel Marcus, Oct 05 2017
    
  • Python
    from sympy import nextprime; a, p = 0, 2; R = [p]
    while p < 618637:
        p=nextprime(p); a += p%4-2
        if a == 0: R.append(p)
    print(*R, sep = ', ')  # Ya-Ping Lu, Jan 18 2025

Extensions

Corrected and extended by Enoch Haga, Feb 24 2004