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

A195325 Least n-gap prime: a(n) = least prime p for which there is no prime between n*p and n*q, where q is the next prime after p.

Original entry on oeis.org

2, 59, 71, 29, 59, 149, 191, 641, 149, 347, 809, 461, 3371, 1487, 857, 1301, 1877, 5849, 4721, 9239, 4271, 1619, 1481, 20507, 20981, 32117, 13337, 19379, 24977, 48779, 20441, 25301, 5651, 37991, 17747, 43577, 176777, 145757, 191249, 84809, 150209, 11717
Offset: 1

Views

Author

Vladimir Shevelev, Sep 15 2011

Keywords

Comments

Such a prime always exists.
The sequence is unbounded.
Conjecture. For n >= 2, a(n) is a lesser of twin primes (A001359). This implies the twin prime conjecture. - Vladimir Shevelev, Sep 15 2011
If a member of this sequence is not the lesser of a twin prime pair, it is greater than 10^10. - Charles R Greathouse IV, Sep 15 2011
A dual sequence: b(n)= least prime p for which there is no prime between n*q and n*p, where q is the previous prime before p. Evidently, b(n) is the next prime after a(n): 3,61,73,31,..., and for n>=2, by the same conjecture, b(n) is a greater of twin primes.

Crossrefs

Programs

  • Maple
    a:= proc(n) local p, q;
          p:= 2; q:= nextprime(p);
          while nextprime(n*p) < (n*q) do
            p, q:= q, nextprime(q)
          od; p
        end:
    seq (a(n), n=1..25); # Alois P. Heinz, Sep 15 2011
  • Mathematica
    pQ[p_, r_] := Block[{q = NextPrime[p]},NextPrime[r*p]> r*q]; f[n_] := Block[{p = 2}, While[ !pQ[p, n], p = NextPrime[p]]; p]; f[1] = 2; Array[f, 42] (* Robert G. Wilson v, Sep 18 2011 *) (* Revised by Zak Seidov, Sep 19 2011 *)

A195270 3-gap primes: Prime p is a term iff there is no prime between 3*p and 3*q, where q is the next prime after p.

Original entry on oeis.org

71, 107, 137, 281, 347, 379, 443, 461, 557, 617, 641, 727, 809, 827, 853, 857, 991, 1031, 1049, 1091, 1093, 1289, 1297, 1319, 1433, 1489, 1579, 1607, 1613, 1697, 1747, 1787, 1867, 1871, 1877, 1931, 1987, 1997, 2027, 2237, 2269, 2309, 2377, 2381, 2473, 2591
Offset: 1

Views

Author

Vladimir Shevelev, Sep 14 2011

Keywords

Comments

For a real r>1, a prime p is called an r-gap prime, if there is no prime between r*p and r*q, where q is the next prime after p. In particular, 2-gap primes are in A080192.
In many cases, q=p+2. E.g., among first 1000 terms there are 509 such cases. - Zak Seidov, Jun 29 2015

Crossrefs

Programs

  • Maple
    filter:= p -> isprime(p) and nextprime(3*p)>3*nextprime(p):
    select(filter, [2,seq(2*i+1,i=1..2000)]); # Robert Israel, Jun 29 2015
  • Mathematica
    pQ[p_, r_] := Block[{q = NextPrime@ p}, Union@ PrimeQ@ Range[r*p, r*q] == {False}]; Select[ Prime@ Range@ 380, pQ[#, 3] &] (* Robert G. Wilson v, Sep 18 2011 *)
    k = 3; p = 71; Reap[Do[While[NextPrime[k*p] < k*(q = NextPrime[p]), p = q]; Sow[p]; p = q, {1000}]][[2, 1]] (* for first 1000 terms. - Zak Seidov, Jun 29 2015 *)
    Prime/@SequencePosition[PrimePi[3*Prime[Range[400]]],{x_,x_}][[;;,1]] (* Harvey P. Dale, Nov 29 2023 *)

A102820 Number of primes between 2*prime(n) and 2*prime(n+1), where prime(n) is the n-th prime.

Original entry on oeis.org

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

Views

Author

Ali A. Tanara (tanara(AT)khayam.ut.ac.ir), Feb 27 2005

Keywords

Comments

Number of primes between successive even semiprimes. [Juri-Stepan Gerasimov, May 01 2010]
From Peter Munn, Jun 01 2023: (Start)
First differences of A020900.
A080192 lists prime(n) corresponding to the zero terms.
A104380(k) is prime(n) corresponding to the first occurrence of k as a term.
If a(n) is nonzero, A059786(n) is the smallest and A059788(n+1) the largest of the a(n) enumerated primes. In the tree of primes described in A290183, these primes label the child nodes of prime(n).
Conjecture: the asymptotic proportions of 0's, 1's, ... , k's, ... are 1/3, 2/9, ... , 2^k/3^(k+1), ... .
(End)

Examples

			a(15)=3 because there are 3 primes between the doubles of the 15th and 16th primes, that is between 2*47 and 2*53.
		

Crossrefs

Sequences with related analysis: A020900, A059786, A059788, A080192, A104380, A290183.
Cf. A104272, A080359. [Vladimir Shevelev, Aug 24 2009]
Sequences with similar definitions: A104289, A217564.

Programs

  • Haskell
    a102820 n = a102820_list !! (n-1)
    a102820_list =  map (sum . (map a010051)) $
       zipWith enumFromTo a100484_list (tail a100484_list)
    -- Reinhard Zumkeller, Apr 29 2012
    
  • Mathematica
    Table[PrimePi[2 Prime[n+1]]-PrimePi[2 Prime[n]], {n, 150}] (* Zak Seidov *)
    Differences[PrimePi[2 Prime[Range[110]]]] (* Harvey P. Dale, Oct 29 2022 *)
  • PARI
    a(n) = primepi(2*prime(n+1)) - primepi(2*prime(n)); \\ Michel Marcus, Sep 22 2017

Formula

a(n) = A020900(n+1) - A020900(n). - Peter Munn, Jun 01 2023

Extensions

More terms from Zak Seidov, Feb 28 2005

A195271 1.5-gap primes: Prime p is a term iff there is no prime between 1.5*p and 1.5*q, where q is the next prime after p.

Original entry on oeis.org

2, 5, 17, 29, 41, 79, 101, 137, 149, 163, 191, 197, 227, 269, 281, 313, 349, 353, 461, 463, 521, 541, 569, 593, 599, 613, 617, 641, 757, 769, 809, 821, 827, 857, 881, 887, 941, 1009, 1049, 1061, 1087, 1093, 1097, 1117, 1151, 1223, 1229, 1277, 1279, 1289
Offset: 1

Views

Author

Vladimir Shevelev, Sep 14 2011

Keywords

Comments

For a real r>1, a prime p is called an r-gap prime, if there is no prime between r*p and r*q, where q is the next prime after p. In particular, 2-gap primes form A080192 and 3-gap primes form A195270.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[400]], PrimePi[3*NextPrime[#]/2] == PrimePi[3*#/2] &] (* T. D. Noe, Sep 14 2011 *)

A080191 Primes p such that p is the largest of all prime factors of the numbers between the prime preceding 2*p and the next prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 61, 67, 73, 79, 83, 89, 97, 103, 109, 113, 127, 131, 137, 139, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 269, 271, 277, 281, 283, 293, 307, 313
Offset: 1

Views

Author

Klaus Brockhaus, Feb 10 2003

Keywords

Comments

Complement of A080192 relative to A000040.
From Flávio V. Fernandes, May 26 2021: (Start)
Equivalently, primes p such that p is the largest of all prime factors of the numbers in the interval [2*p, nextprime(2*p)-1].
For any prime p, if p is not the largest of all prime factors of the numbers in that interval (i.e., if p is not a term of this sequence), then the largest of all prime factors of the numbers in that interval will be a prime q that occurs in the number 2*q.
For all n, the largest prime < 2*a(n) is a term of A059788. (End)

Examples

			5 is a term since 7 is the prime preceding 2*5, 11 is the next prime and 5 is the largest of all prime factors of 8, 9 and 10.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[300], PrimeQ[#] && NextPrime[2*#] < 2 * NextPrime[#] &] (* Amiram Eldar, Feb 07 2020 *)
  • PARI
    {forprime(k=2,317,p=precprime(2*k); q=nextprime(p+1); m=0; for(j=p+1,q-1,f=factor(j); a=f[matsize(f)[1],1]; if(m
    				

Formula

f(precprime(2*p)) = p, where f is the mapping defined by A052248.

A215238 Prime(A215237).

Original entry on oeis.org

2, 3, 113, 1637, 2971, 44293, 305663, 1133071, 370261, 1357201, 46006769, 268119517, 291057379, 3429782117, 10502593103, 10926444583, 87241770619, 226751019497, 1901687257447
Offset: 0

Views

Author

T. D. Noe, Oct 11 2012

Keywords

Comments

We use offset 0 because A215237 uses that offset.
a(n) is least prime(k) such that there are exactly n primes between prime(k)/2 and prime(k+1)/2. - Peter Munn, Oct 22 2017

Crossrefs

Programs

  • Mathematica
    t = Table[PrimePi[Prime[n + 1]/2] - PrimePi[Prime[n]/2], {n, 100000}]; t2 = Flatten[Table[Position[t, n, 1, 1], {n, 0, 8}]]; Prime[t2]

Formula

a(n) = A000040(A215237(n)).

Extensions

a(14)-a(18) from Donovan Johnson, Oct 13 2012

A290183 a(n) is least p to label a node of height n in the rooted tree which has the primes (A000040) as labels for its nonroot nodes, and the parent of the node labeled p is the node labeled with the greatest prime less than p/2 (or the root if there is no such node).

Original entry on oeis.org

59, 331, 163, 79, 37, 17, 724777, 941593, 3578683, 73397147, 52457707, 26228849, 2600553509, 1300276753
Offset: 0

Views

Author

Peter Munn, Jul 23 2017

Keywords

Comments

The parent of the node labeled p is the adjacent node through which it is connected to the root.
The "tree of primes" defined above relates to many older sequences. The node labeled A055377(n) is parent of the node labeled n. The node labeled prime(k) has A102820(k) child nodes and unless it has no child nodes, these are labeled with the primes from A059786(k) to A059788(k+1). The leaf node labels are A080192. The nodes of depth m are those with labels in the interval [A055496(m), A055496(m+1)). The full tree may be defined using A000040 read as a table with row lengths given by A102820 prefixed by 2.
If the set of heights of nodes has a greatest finite value, k, this sequence is finite with k+1 contiguous defined terms.
That said, the author's initial assessment is that occurrence of height n nodes will have similarities to occurrence of least primes of prime k-tuples, namely: (1) labels of nodes of height n will occur almost as though at random intervals amongst the primes; (2) for any n, the apparent odds against a prime p being such a label will not be greater than polynomial in log(p); and thus (3) a(n) plausibly exists for all n.
Some initial empirical observation suggests nodes of height n+1 may occur something like 5 to 10 times less frequently than those of height n.
Terms a(1) to a(5) come from the subtree consisting of the node labeled 17 and its descendants, as depicted in the example section below. This implies 4 consecutive negative first differences, which may be rare later in the sequence.

Examples

			The only prime between 2 * 331 = 662 and 2 * nextprime(331) = 2 * 337 = 674 is 673, so the node labeled 331 is parent only to the node labeled 673. There are no primes between 2 * 673 = 1346 and 2 * nextprime(673) = 2 * 677 = 1354, so the node labeled 673 is a leaf. Thus the node labeled 331 has height 1. It is the least such prime, so a(1) = 331.
The "tree of primes" defined above starts:
                            Root
               +----------------------------+
               2                            3
               |                            |
               5                            7
       +--------------+                 +-------+
      11             13                17      19
       |         +-----------+          |    +----+
      23        29          31         37   41   43
    +----+    +----+    +----+----+     |    |    |
   47   53   59   61   67   71   73    79   83   89
The subtree consisting of the node labeled 17 and all 5 of its descendants is:
      17
       |
      37
       |
      79
       |
     163
       |
     331
       |
     673
From _Peter Munn_, Nov 22 2018: (Start)
The subtree consisting of the node labeled with a(7) = 941593 and its descendants is:
             941593
        +------+--------+
     1883191         1883197
        |               |
     3766387         3766397
                        |
                     7532813
      +-----------------+-----------------+
  15065627          15065639           15065641
      |           +-----------+           |
  30131267    30131279    30131281     30131291
                                          |
                                       60262597
                                          |
                                      120525217
(End)
		

Crossrefs

Cf. A080192 is a list of leaf nodes.
Cf. A055377, A059786, A059788, and A102820 are associated with the parent/child node relationship.

Programs

  • PARI
    lista(nbp) = {my(v = primes(nbp), nv, x); for (n=0, oo, nv = Set(apply(x->precprime(x >> 1), v)); x = vecmin(setminus(v, nv)); if (x > vecmax(nv), break); print1(x, ", "); v = nv;);} /* use nbp=6*10^6 for 7 terms and nbp=2*10^7 for 8 terms */ \\ Michel Marcus, Nov 19 2018
    
  • PARI
    ntimes(p, n) = for (k=1, n, p = precprime(p>>1)); p;
    a(n) = {p = 2; x = ntimes(p, n); p = nextprime(p+1); q = 5; y = ntimes(q, n+1); q = nextprime(q+1); for (k= 1, oo, if (y != x, return (x)); until((ny = ntimes(q, n+1)) != x, q = nextprime(q+1)); until((nx = ntimes(p, n)) != x, p = nextprime(p+1)); x = nx; y = ny;);} \\ Michel Marcus, Dec 08 2018

Formula

a(n) = min (A055377^(n+1) \ A055377^(n+2)), where A055377^(i) denotes the image set of N after i applications of A055377. - clarified following suggestion by Michel Marcus, Nov 13 2018

Extensions

Candidate for a(8) confirmed by Michel Marcus, Nov 14 2018
a(9)-a(13) from Michel Marcus, Jan 02 2019

A195329 Records of A195325.

Original entry on oeis.org

2, 59, 71, 149, 191, 641, 809, 3371, 5849, 9239, 20507, 20981, 32117, 48779, 176777, 191249, 204509, 211061, 223679, 245129, 358877, 654161, 2342771, 3053291, 4297961, 4755347, 6750221, 8019509, 9750371, 10196759, 11237981, 23367077, 34910219, 93929219, 186635747
Offset: 1

Views

Author

Vladimir Shevelev, Sep 15 2011

Keywords

Comments

The sequence is infinite. Conjecture. For n>=2, all terms are in A001359. This conjecture (weaker than the conjecture in comment to A195325) also implies the twin prime conjecture.

Crossrefs

A195379 3.5-gap primes: Primes prime(k) such that there is no prime between 7*prime(k)/2 and 7*prime(k+1)/2.

Original entry on oeis.org

2, 137, 281, 521, 641, 883, 937, 1087, 1151, 1229, 1277, 1301, 1489, 1567, 1607, 1697, 2027, 2081, 2237, 2381, 2543, 2591, 2657, 2687, 2729, 2801, 2851, 2969, 3119, 3257, 3301, 3359, 3463, 3467, 3529, 3673, 3733, 3793, 3821, 3851, 4073, 4217, 4229, 4241, 4259, 4283, 4337, 4421, 4481
Offset: 1

Views

Author

Vladimir Shevelev, Sep 17 2011

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[1000]], PrimePi[7*NextPrime[#]/2] == PrimePi[7*#/2] &] (* T. D. Noe, Sep 20 2011 *)

Extensions

Corrected by R. J. Mathar, Sep 20 2011

A195465 The first a(n) n-gap primes are lessers of twin primes, a(n) maximal.

Original entry on oeis.org

0, 5, 5, 17, 5, 6, 14, 6, 24, 75, 2, 4, 27, 11, 48, 50, 46, 9, 21, 7, 16, 137, 4, 55, 85, 14, 111, 24, 102, 291, 67, 89, 155, 180, 137, 330, 127, 413, 250, 241, 332, 619, 139, 234, 453, 929, 94, 160, 169, 22, 131, 434
Offset: 1

Views

Author

Vladimir Shevelev, Sep 19 2011

Keywords

Comments

For definition of n-gap primes, see comment to A195270.
Conjecture: a(n)>0 for n>1. This conjecture is equivalent to the conjecture that all terms of A195325 are lessers of twin primes.

Crossrefs

Programs

  • Maple
    a:= proc(n) local i, p, q;
          p, q:= 2, 3;
          for i from 0 do
            while nextprime(n*p) < (n*q) do
              p, q:= q, nextprime(q)
            od;
            if not isprime(p+2) then return i fi;
            p, q:= q, nextprime(q)
          od
        end:
    seq(a(n), n=1..20);  # Alois P. Heinz, Sep 20 2011
  • Mathematica
    a[n_] := a[n] = Module[{i, p = 2, q = 3}, For[i = 0, True, i++, While[NextPrime[n p] < n q, p = q; q = NextPrime[q]]; If[!PrimeQ[p+2], Return[i]]; p = q; q = NextPrime[q]]];
    Array[a, 20] (* Jean-François Alcover, Nov 21 2020, after Alois P. Heinz *)
Showing 1-10 of 12 results. Next