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-7 of 7 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

A274122 Let F(g,p) be the frequency of g up to prime nextprime(p+1). Primes p such that F(2,p) = F(4,p) and g = 2 or 4.

Original entry on oeis.org

97, 103, 109, 137, 163, 397, 457, 463, 569, 613, 739, 821, 827, 857, 2111, 2137, 2203, 2239, 2269, 2309, 2347, 2381, 4127, 4217, 8803, 9337, 12487, 12739, 12889, 12917, 19991, 20021, 20717, 20747, 20771, 20959, 21187, 21313, 21319, 21379, 21599, 21613, 21817, 21859, 22037, 22091, 22129, 22157, 22271, 22277, 22481, 22567
Offset: 1

Views

Author

David A. Corneth, Jun 10 2016

Keywords

Comments

Gaps 2 and 4 are conjectured to occur roughly equally often and each occur infinitely often (see link "Polignac's conjecture").
Conjecture: This sequence is infinite.

Examples

			Up to 89, gaps 2 and 4 occur respectively 8 and 7 times. After 97 (the next prime after 89), there is a gap of 4. So up to 97, gaps 2 and 4 occur the same number of times and the gap after 97 is 2 or 4, so 97 is in the sequence.
		

Crossrefs

Programs

  • PARI
    \\ See link by name "PARI program" for an extended version with comments.
    upto(n) = {my(gapcount=List(),is24 = List()); 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(g<6&&#gapcount>1,if(gapcount[1]==gapcount[2],listput(is24,i)))); is24} \\ David A. Corneth, Jun 28 2016

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

A356223 Position of n-th appearance of 2n in the sequence of prime gaps (A001223). If 2n does not appear at least n times, set a(n) = -1.

Original entry on oeis.org

2, 6, 15, 79, 68, 121, 162, 445, 416, 971, 836, 987, 2888, 1891, 1650, 5637, 5518, 4834, 9237, 8152, 10045, 21550, 20248, 20179, 29914, 36070, 24237, 53355, 52873, 34206, 103134, 90190, 63755, 147861, 98103, 117467, 209102, 206423, 124954, 237847, 369223
Offset: 1

Views

Author

Gus Wiseman, Aug 04 2022

Keywords

Comments

Prime gaps (A001223) are the differences between consecutive prime numbers. They begin: 1, 2, 2, 4, 2, 4, 2, 4, 6, ...

Examples

			We need the first 15 prime gaps (1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6) before we reach the 3rd appearance of 6, so a(6) = 15.
		

Crossrefs

The first appearances are at A038664, seconds A356221.
Diagonal of A356222.
A001223 lists the prime gaps.
A073491 lists numbers with gapless prime indices.
A356224 counts divisors with gapless prime indices, complement A356225.
A356226 = gapless interval lengths of prime indices, run-lengths A287170.

Programs

  • Mathematica
    nn=1000;
    gaps=Differences[Array[Prime,nn]];
    Table[Position[gaps,2*n][[n,1]],{n,Select[Range[nn],Length[Position[gaps,2*#]]>=#&]}]

A356221 Position of second appearance of 2n in the sequence of prime gaps A001223; if 2n does not appear at least twice, a(n) = -1.

Original entry on oeis.org

3, 6, 11, 72, 42, 47, 62, 295, 180, 259, 297, 327, 446, 462, 650, 1315, 1059, 1532, 4052, 2344, 3732, 3861, 8805, 7234, 4754, 2810, 4231, 14124, 5949, 9834, 17200, 10229, 19724, 25248, 15927, 30765, 42673, 28593, 24554, 50523, 44227, 44390, 29040, 89715, 47350
Offset: 1

Views

Author

Gus Wiseman, Aug 02 2022

Keywords

Comments

Prime gaps (A001223) are the differences between consecutive prime numbers. They begin: 1, 2, 2, 4, 2, 4, 2, 4, 6, ...

Crossrefs

The position of the first (instead of second) appearance of 2n is A038664.
Column k = 2 of A356222.
The position of the n-th appearance of 2n is A356223.
A001223 lists the prime gaps, reduced A028334.
A073491 lists numbers with gapless prime indices.
A274121 counts appearances of the n-th prime gap in those prior.
A356226 gives the lengths of maximal gapless intervals of prime indices.

Programs

  • Mathematica
    nn=1000;
    gaps=Differences[Array[Prime,nn]];
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    Table[Position[gaps,2*n][[2,1]],{n,mnrm[Select[Range[nn],Length[Position[gaps,2*#]]>=2&]]}]

A356222 Array read by antidiagonals upwards where A(n,k) is the position of the k-th appearance of 2n in the sequence of prime gaps A001223. If A001223 does not contain 2n at least k times, set A(n,k) = -1.

Original entry on oeis.org

2, 4, 3, 9, 6, 5, 24, 11, 8, 7, 34, 72, 15, 12, 10, 46, 42, 77, 16, 14, 13, 30, 47, 53, 79, 18, 19, 17, 282, 62, 91, 61, 87, 21, 22, 20, 99, 295, 66, 97, 68, 92, 23, 25, 26, 154, 180, 319, 137, 114, 80, 94, 32, 27, 28, 189, 259, 205, 331, 146, 121, 82, 124, 36, 29, 33
Offset: 1

Views

Author

Gus Wiseman, Aug 04 2022

Keywords

Comments

Prime gaps (A001223) are the differences between consecutive prime numbers. They begin: 1, 2, 2, 4, 2, 4, 2, 4, 6, ...
This is a permutation of the positive integers > 1.

Examples

			Array begins:
        k=1 k=2 k=3 k=4 k=5 k=6 k=7 k=8 k=9
  n=1:   2   3   5   7  10  13  17  20  26
  n=2:   4   6   8  12  14  19  22  25  27
  n=3:   9  11  15  16  18  21  23  32  36
  n=4:  24  72  77  79  87  92  94 124 126
  n=5:  34  42  53  61  68  80  82 101 106
  n=6:  46  47  91  97 114 121 139 168 197
  n=7:  30  62  66 137 146 150 162 223 250
  n=8: 282 295 319 331 335 378 409 445 476
  n=9:  99 180 205 221 274 293 326 368 416
For example, the positions in A001223 of appearances of 2*3 begin: 9, 11, 15, 16, 18, 21, 23, ..., which is row n = 3 (A320701).
		

Crossrefs

The row containing n is A028334(n).
Row n = 1 is A029707.
Row n = 2 is A029709.
Column k = 1 is A038664.
The column containing n is A274121(n).
Column k = 2 is A356221.
The diagonal A(n,n) is A356223.
A001223 lists the prime gaps.
A073491 lists numbers with gapless prime indices.
A356224 counts even divisors with gapless prime indices, complement A356225.

Programs

  • Mathematica
    gapa=Differences[Array[Prime,10000]];
    Table[Position[gapa,2*(k-n+1)][[n,1]],{k,6},{n,k}]

A373891 Number of primes less than prime(n) having the same difference between consecutive primes as prime(n).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Jun 21 2024

Keywords

Examples

			a(7) = 3 because A001223(7) = 2 and also A001223(2) = A001223(3) = A001223(5) = 2.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[n - 1], Prime[# + 1] - Prime[#] == Prime[n + 1] - Prime[n] &]], {n, 80}]
  • PARI
    a(n) = my(vp = primes(n+1), dvp = vector(#vp-1, k, vp[k+1]-vp[k])); sum(i=1, #dvp-1, dvp[i] == dvp[#dvp]); \\ Michel Marcus, Jun 27 2024

Formula

a(n) = |{j < n : A001223(j) = A001223(n)}|.
a(n) = A274121(n) - 1.
Showing 1-7 of 7 results.