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

A166251 Isolated primes: Primes p such that there is no other prime in the interval [2*prevprime(p/2), 2*nextprime(p/2)].

Original entry on oeis.org

5, 7, 23, 37, 79, 83, 89, 163, 211, 223, 257, 277, 317, 331, 337, 359, 383, 389, 397, 449, 457, 467, 479, 541, 547, 557, 563, 631, 673, 701, 709, 761, 787, 797, 839, 863, 877, 887, 919, 929, 977, 1129, 1181, 1201, 1213, 1237, 1283, 1307, 1327, 1361, 1399, 1409
Offset: 1

Views

Author

Vladimir Shevelev, Oct 10 2009, Oct 14 2009

Keywords

Comments

Other formulation: Suppose a prime p >= 5 lies in the interval (2p_k, 2p_(k+1)), where p_n is the n-th prime; p is called isolated if the interval (2p_k, 2p_(k+1)) does not contain any other primes.
The sequence is connected with the following classification of primes: The first two primes 2,3 form a separate set of primes; let p >= 5 be in interval(2p_k, 2p_(k+1)), then 1)if in this interval there are primes only more than p, then p is called a right prime; 2) if in this interval there are primes only less than p, then p is called a left prime; 3) if in this interval there are prime more and less than p, then p is called a central prime; 4) if this interval does not contain other primes, then p is called an isolated prime. In particular, the right primes form sequence A166307 and all Ramanujan primes (A104272) more than 2 are either right or central primes; the left primes form sequence A182365 and all Labos primes (A080359) greater than 3 are either left or central primes.
From Peter Munn, Jun 01 2023: (Start)
The isolated primes are prime(k) such that k-1 and k occur as consecutive terms in A020900.
In the tree of primes described in A290183, the isolated primes label the nodes with no sibling nodes.
Conjecture: a(n)/A000040(n) is asymptotic to 9. This would follow from my conjectured asymptotic proportion of 1's in A102820 (the first differences of A020900).
(End)

Examples

			Since 2*17 < 37 < 2*19, and the interval (34, 38) does not contain other primes, 37 is an isolated prime.
		

Crossrefs

Programs

  • Haskell
    a166251 n = a166251_list !! (n-1)
    a166251_list = concat $ (filter ((== 1) . length)) $
       map (filter ((== 1) . a010051)) $
       zipWith enumFromTo a100484_list (tail a100484_list)
    -- Reinhard Zumkeller, Apr 27 2012
    
  • Mathematica
    isolatedQ[p_] := p == NextPrime[2*NextPrime[p/2, -1]] && p == NextPrime[2*NextPrime[p/2], -1]; Select[Prime /@ Range[300], isolatedQ] (* Jean-François Alcover, Nov 29 2012, after M. F. Hasler *)
  • PARI
    is_A166251(n)={n==nextprime(2*precprime(n\2)) & n==precprime(2*nextprime(n/2))}  \\ M. F. Hasler, Oct 05 2012

Extensions

Edited by N. J. A. Sloane, Oct 15 2009
More terms from Alois P. Heinz, Apr 26 2012
Given terms double-checked with new PARI code by M. F. Hasler, Oct 05 2012

A020900 Greatest k such that k-th prime < twice n-th prime.

Original entry on oeis.org

2, 3, 4, 6, 8, 9, 11, 12, 14, 16, 18, 21, 22, 23, 24, 27, 30, 30, 32, 34, 34, 37, 38, 40, 44, 46, 46, 47, 47, 48, 54, 55, 58, 59, 62, 62, 65, 66, 67, 68, 71, 72, 75, 76, 77, 78, 82, 86, 87, 88, 90, 91, 92, 95, 97, 99, 99, 100, 101, 102, 103, 106, 112
Offset: 1

Views

Author

Keywords

Examples

			4th prime is 7, twice the 4th prime is 14, the greatest prime < 14 is 13 that is the 6th prime, hence, a(4) = 6. - _Bernard Schott_, Feb 02 2020
		

Crossrefs

Cf. A000720 (pi(n)), A100484 (2*prime(n)).
Cf. A102820 (first differences).

Programs

  • Mathematica
    PrimePi[NextPrime[#,-1]]&/@(2Prime[Range[70]]) (* Harvey P. Dale, Jul 05 2012 *)
  • PARI
    a(n) = primepi(2*prime(n)); \\ Michel Marcus, Oct 25 2017; Feb 02 2020

Formula

a(n) = A000720(A100484(n)). - Michel Marcus, Feb 02 2020

A080192 Complement of A080191 relative to A000040. Prime p is a term iff there is no prime between 2*p and 2*q, where q is the next prime after p.

Original entry on oeis.org

59, 71, 101, 107, 149, 263, 311, 347, 461, 499, 521, 569, 673, 757, 821, 823, 857, 881, 883, 907, 967, 977, 1009, 1061, 1091, 1093, 1151, 1213, 1279, 1283, 1297, 1301, 1319, 1433, 1487, 1489, 1493, 1549, 1571, 1597, 1619, 1667, 1697, 1721, 1787, 1871, 1873
Offset: 1

Views

Author

Klaus Brockhaus, Feb 10 2003

Keywords

Comments

From Peter Munn, Oct 19 2017: (Start)
This is also a list of the leaf node labels in the tree of primes described in A290183.
For k > 0, the earliest run of k adjacent primes in this sequence starts with the least prime greater than A215238(k+1)/2. Thus we see that A215238(3) = 1637 corresponds to 821 followed by 823 being the first run of 2 adjacent primes in this sequence.
(End)
From Peter Munn, Nov 02 2017: (Start)
If p is in A005384 (a Sophie Germain prime), 2p+1 is therefore a prime, so p cannot be in this sequence. Similarly, any prime p in A023204 has a corresponding prime 2p+3, which (if p>2) likewise implies its absence (and if p=2 it is in A005384).
If p is the lesser of twin primes it is in this sequence if it is neither Sophie Germain nor in A023204.
Conjecture: a(n)/A000040(n) is asymptotic to 3. Reason: I expect the distribution of terms in A102820 to converge to a geometric distribution with mean value 2.
(End)

Examples

			59 is a term since 113 is the prime preceding 2*59, 127 is the next prime and 61 is the largest of all prime factors of 114, ..., 122 = 2*61, ..., 126.
		

Crossrefs

A080191 is the complement of this sequence relative to A000040.
Sequences with related analysis: A005384, A023204, A052248, A102820, A215238, A290183.
Sequences with similar definitions: A195270, A195271, A195325, A195377.

Programs

  • Mathematica
    Select[Prime[Range[300]],NextPrime[2#]>2NextPrime[#]&] (* Harvey P. Dale, Jul 07 2011 *)
  • NARS2000
    ¯1↓b/⍨(1⌽a)<1πa←2×b←¯2π⍳1E4 ⍝ Michael Turniansky, Dec 29 2020
  • PARI
    {forprime(k=2,1873,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
    				
  • PARI
    isok(p) = isprime(p) && (primepi(2*p) == primepi(2*nextprime(p+1)));
    forprime(p=2, 2000, if (isok(p), print1(p, ", "))) \\ Michel Marcus, Sep 22 2017
    
  • PARI
    first(n) = my(res = vector(n), i = 0); {n==0&&return([]); forprime(p = 2, , if(nextprime(2*p) > 2*nextprime(p + 1), i++; res[i] = p; if(i == n, return(res))))} \\ David A. Corneth, Oct 25 2017
    

Formula

For all k, prime(k) = A000040(k) is a term if and only if A102820(k) = 0. - Peter Munn, Oct 24 2017

A217564 Number of primes between prime(n)/2 and prime(n+1)/2.

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 2, 0, 1, 0, 2, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 2, 2, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1
Offset: 1

Views

Author

Hans Havermann, Oct 06 2012

Keywords

Comments

Conjecture: this sequence is unbounded, as implied by Dickson's conjecture. - Charles R Greathouse IV, Oct 09 2012
Conjecture: 0 appears infinitely often. - Jon Perry, Oct 10 2012
First differences of A079952. - Peter Munn, Oct 19 2017

Examples

			a(30) = 2 because there are two primes between prime(30)/2 [=113/2] and prime(31)/2 [=127/2]; i.e., the numbers 59 and 61.
		

Crossrefs

Cf. A215237 (location of first n).
A164368 lists the prime(n) corresponding to the zero terms.

Programs

  • Mathematica
    q = 2; Table[p = q; q = NextPrime[p]; Length[Position[PrimeQ[Range[p + 1, q - 1, 2]/2], True]], {105}]
    Table[PrimePi[Prime[n + 1]/2] - PrimePi[Prime[n]/2], {n, 105}] (* Alonso del Arte, Oct 08 2012 *)

Formula

a(n) = pi(prime(n + 1)/2) - pi(prime(n)/2), where pi is the prime counting function and prime(n) is the n-th prime.
Equivalently, a(n) = A079952(n+1) - A079952(n). - Peter Munn, Oct 19 2017
The average order of a(n) is 1/2, that is, a(1) + a(2) + ... + a(n) ~ n/2. - Charles R Greathouse IV, Oct 09 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

A104380 Smallest prime p(i) such that between 2p(i) and 2p(i+1) there exist n primes.

Original entry on oeis.org

59, 2, 5, 31, 89, 509, 113, 1129, 1951, 7253, 19609, 16141, 13339, 28229, 1327, 281431, 396733, 1122287, 461717, 370261, 2010733, 492113, 3279841, 14246971, 3117299, 5826001, 20831323, 47326693, 60487759, 189695659, 191912783, 1301171033, 2044207843, 3129752191, 476956933, 836806669, 2433630109
Offset: 0

Views

Author

Ali A. Tanara (tanara(AT)khayam.ut.ac.ir) and Robert G. Wilson v, Mar 03 2005

Keywords

Examples

			a(0)=59 because between 2*59=118 and 2*61=122 there are no primes and 59 is the least prime with this characteristic.
a(4)=89 because between 2*89=178 and 2*97=194 there are 4 primes, namely 179, 181, 191 and 193.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := PrimePi[2Prime[n + 1]] - PrimePi[2Prime[n]]; t = Table[0, {30}]; Do[a = f[n]; If[t[[a + 1]] == 0, t[[a + 1]] = Prime[n]], {n, 2500000}]; t
  • PARI
    ct(a,b)=sum(k=a,b,isprime(k))
    a(n)=my(p=2); forprime(q=3,, if(ct(2*p+1,2*q-1)==n, return(p)); p=q) \\ Charles R Greathouse IV, Nov 05 2017

Extensions

a(27)-a(36) from Charles R Greathouse IV, Nov 05 2017

A104289 Number of primes between n*prime(n) and n*prime(n+1).

Original entry on oeis.org

0, 1, 2, 5, 2, 5, 2, 6, 9, 2, 11, 8, 3, 9, 12, 14, 6, 13, 12, 9, 18, 11, 17, 23, 9, 7, 14, 8, 16, 52, 14, 23, 6, 40, 8, 26, 24, 22, 27, 26, 6, 45, 13, 19, 8, 63, 60, 21, 9, 18, 34, 13, 56, 35, 33, 36, 12, 37, 24, 13, 62, 81, 31, 16, 26, 97, 37, 67, 15, 24, 43, 59, 41, 47, 37, 44, 58
Offset: 1

Views

Author

Zak Seidov, Feb 28 2005

Keywords

Comments

Case n=1 is degenerate as 1*prime(1)=2, 1*prime(2)=3 and between 2 and 3 there is no prime while (PrimePi[n Prime[n+1]]-PrimePi[n Prime[n]]/.n->1) gives 1.

Examples

			a(4)=5 because between 4*prime(4)=4*7=28 and 4*prime(5)=4*11=44, there are exactly 5 primes: 29,31,37,41,43.
		

Crossrefs

Programs

  • Mathematica
    A104289=Prepend[Table[PrimePi[n Prime[n+1]]-PrimePi[n Prime[n]], {n, 2, 100}], 0]

Formula

a(n) = pi(n*prime(n+1)) - pi(n*prime(n)) for n > 1 with a(1) = 0. - Wesley Ivan Hurt, Dec 27 2023

A336298 Greatest prime < prime(n)/2.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 11, 13, 13, 17, 19, 19, 23, 23, 29, 29, 31, 31, 31, 37, 41, 43, 47, 47, 47, 53, 53, 53, 61, 61, 67, 67, 73, 73, 73, 79, 83, 83, 89, 89, 89, 89, 97, 97, 103, 109, 113, 113, 113, 113, 113, 113, 127, 131, 131, 131, 137, 139, 139, 139, 151, 151
Offset: 3

Views

Author

Clark Kimberling, Nov 16 2020

Keywords

Comments

The n-th prime appears A102820(n) times. - Flávio V. Fernandes, Apr 08 2021
A080191 lists the distinct terms of this sequence. - Flávio V. Fernandes, Jun 19 2021

Examples

			Prime(3)/2 = 2.5, so a(3) = 2.
		

Crossrefs

Programs

  • Mathematica
    z = 120; t = Table[NextPrime[Prime[n]/2], {n, 3, z}]; (* A039734, A079953 *)
    u = NextPrime[t, -1]  (* A336298 *)
    t - u (* A336299 *)
    Table[NextPrime[Prime[n]/2, -1], {n, 3, 80}] (* Wesley Ivan Hurt, Nov 26 2020 *)
  • PARI
    a(n) = precprime(prime(n)/2); \\ Michel Marcus, Nov 16 2020
    
  • Python
    from sympy import prime, prevprime
    def A336298(n):
        return prevprime(prime(n)//2+1) # Chai Wah Wu, Nov 26 2020

Formula

a(n) = A151799(A000040(n)/2) for n >= 3. - Wesley Ivan Hurt, Nov 26 2020
Showing 1-8 of 8 results.