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.

Previous Showing 11-20 of 41 results. Next

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

A156749 For all numbers k(n) congruent to -1 or +1 (mod 4) starting with k(n) = {3,5,7,9,11,...}, a(k(n)) is incremented by the congruence (mod 4) if k(n) is prime and by 0 if k(n) is composite.

Original entry on oeis.org

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

Views

Author

Daniel Forgues, Feb 14 2009

Keywords

Comments

The fact that a(k(n)) is predominantly negative exhibits the Chebyshev Bias (where the congruences that are not quadratic residues generally lead in the prime number races, at least for "small" integers, over the congruences that are quadratic residues).
This bias seems caused (among other causes?) by the presence of all those squares (even powers) coprime to 4 taking away opportunities for primes to appear in the quadratic residue class +1 (mod 4), while the non-quadratic residue class -1 (mod 4) is squarefree.
The density of squares congruent to +1 (mod 4) is 1/(4*sqrt(k(n))) since 1/2 of squares are congruent to +1 (mod 4), while the density of primes in either residue class -1 or +1 (mod 4) is 1/(phi(4)*log(k(n))), with phi(4) = 2.
Here 1 is quadratic residue mod 4, but 3 (or equivalently -1) is quadratic non-residue mod 4. All the even powers (included in the squares) map congruences {-1, +1} to {+1, +1} respectively and so contribute to the bias, whereas all the odd powers map {-1, +1} to {-1, +1} respectively and so do not contribute to the bias.
One would then expect the ratio of this bias, if caused exclusively by the even powers, relative to the number of primes in either congruences to asymptotically tend towards to 0 as k(n) increases (since 1/(4*sqrt(k(n))) is o(1/(phi(4)*log(k(n))))).
The persistence or not of such bias in absolute value then does not contradict The Prime Number Theorem for Arithmetic Progressions (Dirichlet) which states that the asymptotic (relative) ratio of the count of prime numbers in each congruence class coprime to m tends to 1 in the limit towards infinity. (Cf. 'Prime Number Races' link below.)
Also, even if this bias grows in absolute value, it is expected to be drowned out (albeit very slowly) by the increasing fluctuations in the number of primes in each congruence class coprime to 4 since, assuming the truth of the Riemann Hypothesis, their maximum amplitude would be, with x standing for k(n) in our case, h(x) = O(sqrt(x)*log(x)) <= C*sqrt(x)*log(x) in absolute value which gives relative fluctuations of order h(x)/x = O(log(x)/sqrt(x)) <= C*log(x)/sqrt(x) in the densities of primes pi(x, {4, 1})/x and pi(x, {4, 3})/x in either congruence class.
Since 1/(4*sqrt(x)) is o(log(x)/sqrt(x)) the bias will eventually be overwhelmed by the "pink noise or nearly 1/f noise" corresponding to the fluctuations in the prime densities in either congruence class. The falsehood of the Riemann Hypothesis would imply even greater fluctuations since the RH corresponds to the minimal h(x).
We get pink noise or nearly 1/f noise if we consider the prime density fluctuations of pi(x, {4, k})/x as an amplitude spectrum over x (with a power density spectrum of (C*log(x)/sqrt(x))^2 = ((C*log(x))^2)/x and see x as the frequency f. This power density spectrum is then nearly 1/x and would have nearly equal energy (although slowly increasing as (C*log(x))^2) for each octave of x. (Cf. 'Prime Numbers: A Computational Perspective' link below.)
Among the positive integers k(n) up to 100000 that are congruent to -1 or +1 (mod 4) [indexed from n = 1 to 49999, with k(n) = 4*ceiling(n/2) + (-1)^n], a tie is attained or maintained, with a(k(n)) = 0, for only 34 integers and that bias favoring the non-quadratic residue class -1 (mod 4) gets violated only once, i.e., a(k(n)) = +1, for index n = 13430 (corresponding to the prime k(n) = 26861 congruent to +1 (mod 4) since n is even) where the congruence +1 leads once!

References

  • Richard E. Crandall and Carl Pomerance, Prime Numbers: A Computational Perspective

Crossrefs

Programs

  • Mathematica
    Table[Which[!PrimeQ[2*n+1], 0, Mod[2*n+1, 4] == 1, 1, True, -1], {n, 1, 100}] // Accumulate (* Jean-François Alcover, Dec 09 2014 *)

Formula

a(n) = -A066520(2*n+1) = A066339(2*n+1) - A066490(2*n+1). - Jonathan Sondow, May 17 2013

Extensions

Edited by Daniel Forgues, Mar 01 2009, Mar 29 2009

A297408 Where the prime race among 10k+1, ..., 10k+9 changes leader.

Original entry on oeis.org

2, 13, 157, 193, 347, 383, 587, 673, 907, 1163, 1327, 1483, 1907, 1933, 2897, 4723, 5557, 5573, 6037, 6113, 6637, 6673, 7487, 8273, 8317, 8363, 8387, 8443, 8467, 8573, 8647, 8803, 8837, 8933, 9277, 9293, 10067, 10103, 11897, 11923, 12037, 12073, 12107, 12143
Offset: 1

Views

Author

Sean A. Irvine, Dec 29 2017

Keywords

Comments

A007355 appears to be an erroneous version of this sequence.

Crossrefs

Programs

  • PARI
    a297408(limit)={my(v=vector(10),vm=0,ivm=0,imv); forprime(p=2,limit,my(m=p%10);v[m]++;my(mv=vecmax(v,&imv));if(mv>vm,if(imv!=ivm,print1(p,", "); ivm=imv);vm=mv))};
    a297408(12500) \\ Hugo Pfoertner, Jul 25 2021
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen():
        c, p, leader = [0 for i in range(10)], 1, None
        while True:
            p = nextprime(p); last = p%10; c[last] += 1; m = max(c)
            if c.count(m) == 1 and c.index(m) == last and last != leader:
                yield p; leader = last
    print(list(islice(agen(), 44))) # Michael S. Branicky, Dec 20 2022

A007353 Where the prime race among 5k+1, ..., 5k+4 changes leader.

Original entry on oeis.org

2, 83, 137, 293, 337, 443, 487, 523, 557, 743, 797, 1213, 1277, 1523, 1657, 1733, 1867, 1973, 2027, 2063, 2797, 2833, 2887, 4733, 5227, 5323, 5437, 5503, 5527, 5623, 5897, 5923, 6007, 6133, 6317, 6353, 6427, 6563, 6607, 6703, 7187, 7283, 7307, 7393, 7477, 8963
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A007354 Where the prime race among 7k+1, ..., 7k+6 changes leader.

Original entry on oeis.org

2, 17, 131, 227, 733, 829, 929, 997, 1097, 1123, 1237, 1277, 1447, 1487, 1531, 1627, 1811, 1907, 1993, 2141, 2203, 2267, 2441, 2677, 2707, 3209, 3299, 3433, 3547, 3853, 4003, 4021, 4507, 4679, 4787, 4931, 5081, 5113, 7537, 7577, 7649, 7759, 7817, 8039, 8461, 8543
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • PARI
    primerace(mod,limit)={my(v=vector(mod), vm=0, ivm=0, imv); forprime(p=2, limit, my(m=p%mod); v[m+1]++;  v[m+1]++; my(mv=vecmax(v, &imv)); if(mv>vm, if(imv!=ivm, print1(p, ", "); ivm=imv); vm=mv))};
    primerace(7,8600) \\ Hugo Pfoertner, Jul 25 2021

A297406 Where the prime race among 8k+1, ..., 8k+7 changes leader.

Original entry on oeis.org

2, 11, 37, 83, 197, 227, 271, 293, 347, 373, 487, 547, 853, 907, 1069, 1447, 1733, 1831, 1949, 2027, 2053, 2131, 2237, 2251, 2309, 2719, 2749, 3019, 3061, 3083, 3733, 3779, 3877, 3931, 4919, 5179, 5303, 5347, 5407, 6661, 6911, 6949, 6967, 7459, 7789
Offset: 1

Views

Author

Sean A. Irvine, Dec 29 2017

Keywords

Crossrefs

Programs

  • Maple
    X:= Vector(4): X[2]:= 1: m:= 3: p:= 3: count:= 1: R:= 2:
    for i from 2 while count < 100 do
      p:= nextprime(p);
      j:= ((p mod 8)+1)/2;
      X[j]:= X[j]+1;
      mp:= max[index](X);
      if mp <> m and X[mp] > X[m] then
        m:= mp;
        R:= R,p;
        count:= count+1;
       fi
    od:
    R; # Robert Israel, Nov 21 2024

A297407 Where the prime race among 9k+1, ..., 9k+8 changes leader.

Original entry on oeis.org

2, 167, 191, 419, 461, 563, 587, 617, 677, 761, 857, 881, 929, 1427, 1451, 1607, 1667, 1777, 1823, 1867, 1913, 2351, 2399, 2459, 4127, 4583, 5039, 5087, 5171, 7283, 7349, 7517, 7547, 7643, 7691, 7901, 8681, 8837, 8933, 11243, 11903, 11927, 18329, 18371, 19913
Offset: 1

Views

Author

Sean A. Irvine, Dec 29 2017

Keywords

Crossrefs

Programs

  • Maple
    V:= <(0$8)>:
    lead:= 1:
    Res:= NULL:
    count:= 0:
    p:= 1:
    while count < 100 do
      p:= nextprime(p);
      t:= p mod 9;
      V[t]:= V[t]+1;
      if V[t] > V[lead] then
        lead:= t;
        Res:= Res, p;
        count:= count+1;
      fi
    od:
    Res; # Robert Israel, Jan 01 2018

A297410 Where the prime race among 11k+1, ..., 11k+10 changes leader.

Original entry on oeis.org

2, 73, 101, 149, 233, 359, 431, 509, 563, 1051, 1091, 1151, 1259, 1459, 1553, 1811, 2609, 2713, 2741, 4363, 4507, 4561, 4919, 5023, 5189, 6761, 7321, 7433, 7717, 7829, 8039, 8081, 8951, 9043, 9203, 9337, 9851, 9931, 10181, 10457, 11437, 11491, 13099, 19841
Offset: 1

Views

Author

Sean A. Irvine, Dec 29 2017

Keywords

Crossrefs

Previous Showing 11-20 of 41 results. Next