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-3 of 3 results.

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

A274121 The gap prime(n+1) - prime(n) occurs for the a(n)-th time.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 4, 3, 1, 5, 2, 4, 6, 5, 3, 4, 7, 5, 6, 8, 6, 7, 7, 1, 8, 9, 9, 10, 10, 1, 11, 8, 11, 1, 12, 9, 10, 12, 11, 12, 13, 2, 14, 13, 15, 1, 2, 14, 16, 15, 13, 17, 3, 14, 15, 16, 18, 17, 16, 19, 4, 2, 17, 20, 18, 3, 18, 5, 21, 19, 19, 2, 20, 21, 20, 22, 3, 21, 4, 6, 22, 7, 23, 23, 22, 24, 5, 23, 24, 24, 3, 6
Offset: 1

Views

Author

David A. Corneth, Jun 10 2016

Keywords

Comments

Terms of this sequence grow without bound; any even number occurs in this sequence. Zhang proved that there are infinitely many primes 4680 apart from each other (see link "Bounded gaps between primes").
For a conjectured count of gap n below x, see link Polignac's conjecture.
Polignac's conjecture states that "For any positive even number n, there are infinitely many prime gaps of size n.". By this conjecture, every positive apppears infinitely many times in this sequence (see link "Polignac's conjecture").

Examples

			(p, g) denotes a prime p and the gap up to the next prime. So p + g is the next prime after p. These pairs start (2, 1), (3, 2), (5, 2), (7, 4), (11, 2). From here we see that:
- the gap after the first prime, 1 occurs for the first time, so a(1) = 1.
- the gap after the second prime, 2, occurs for the first time, so a(2) = 1.
- the gap after the third prime, 2, occurs for the second time, so a(3) = 2.
- the gap after the fourth prime, 4, occurs for the first time, so a(4) = 1.
- the gap after the fifth prime, 2, occurs for the third time, so a(5) = 3.
		

Crossrefs

Programs

  • PARI
    \\ See link by name "PARI program" for an extended version with comments.
    upto(n) = {my(gapcount=List(), freqgap = List([1])); n = max(n, 3); forprime(i=3,n,
    g = nextprime(i+1) - i; for(i=#gapcount+1, g\2, listput(gapcount,0));  gapcount[g\2]++; listput(freqgap,gapcount[g\2]));freqgap} \\ David A. Corneth, Jun 28 2016

Formula

a(primepi(A000230(n))) = 1.
a(primepi(A001359(n))) = n.
a(primepi(A029710(n))) = n.

A274123 Let F(g,p) be the frequency of g up to the prime nextprime(p+1). F(g,p_i) is a record for some prime p_i and F(g, p_(i+1)) is a new record for the next larger prime after p_i. The sequence lists the primes p_(i+1), except a(1) = 2.

Original entry on oeis.org

2, 127, 149, 383, 431, 443, 487, 557
Offset: 1

Views

Author

David A. Corneth, Jun 10 2016

Keywords

Comments

Up to large values of n, 6 is conjectured to be the most occurring gap. See link "Polignac's conjecture". If this conjecture is true the sequence is finite.
For primes up to 10^8, there are no more terms. Up to 10^6, the prime gap 2 occurs 8169 times, the gap 4 occurs 8143 times and the gap 6 occurs 13549 times.

Examples

			Before counting gaps, all gaps are zero, so the first pass happens after the first prime, 2. Up to and including 113, a gap of 2 occurs at least as often as any other gap. At prime 113, the gaps 2 and 4 are the most frequent (both occur 10 times). After 127, the next prime after 113, there is a gap of 4. So at the prime 127, the gap 4 has occurs the most of all gaps. This was not the case at the prime previous to 127 (the prime 113). Therefore, 127 is in the sequence.
		

Crossrefs

Programs

  • PARI
    \\ See link by name "PARI program" for an extended version with comments.
    upto(n) = {my(gapcount=List(),passes=List(),gmax = 0,imax = 0);
    n=max(n,3); forprime(i=3, n, g = nextprime(i+1) - i; for(i = #gapcount+1, g\2, listput(gapcount,0)); gapcount[g\2]++; if(gapcount[g\2] > gmax,gmax = gapcount[g\2];if(imax!=g\2,listput(passes,i);imax=g\2)));passes[1]=2; passes} \\ David A. Corneth, Jun 28 2016
Showing 1-3 of 3 results.