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

A075579 Duplicate of A059788.

Original entry on oeis.org

3, 5, 7, 13, 19, 23, 31, 37, 43, 53, 61, 73, 79, 83, 89, 103, 113, 113, 131, 139, 139, 157
Offset: 0

Views

Author

Keywords

A164368 Primes p with the property: if q is the smallest prime > p/2, then a prime exists between p and 2q.

Original entry on oeis.org

2, 11, 17, 29, 41, 47, 59, 67, 71, 97, 101, 107, 109, 127, 137, 149, 151, 167, 179, 181, 191, 197, 227, 229, 233, 239, 241, 263, 269, 281, 283, 307, 311, 347, 349, 367, 373, 401, 409, 419, 431, 433, 439, 461, 487, 491, 503, 521, 569, 571, 587, 593, 599, 601, 607
Offset: 1

Views

Author

Vladimir Shevelev, Aug 14 2009

Keywords

Comments

The Ramanujan primes possess the following property:
If p = prime(n) > 2, then all numbers (p+1)/2, (p+3)/2, ..., (prime(n+1)-1)/2 are composite.
The sequence equals all primes with this property, whether Ramanujan or not.
All Ramanujan primes A104272 are in the sequence.
Every lesser of twin primes (A001359), beginning with 11, is in the sequence. - Vladimir Shevelev, Aug 31 2009
109 is the first non-Ramanujan prime in this sequence.
A very simple sieve for the generation of the terms is the following: let p_0=1 and, for n>=1, p_n be the n-th prime. Consider consecutive intervals of the form (2p_n, 2p_{n+1}), n=0,1,2,... From every interval containing at least one prime we remove the last one. Then all remaining primes form the sequence. Let us demonstrate this sieve: For p_n=1,2,3,5,7,11,... consider intervals (2,4), (4,6), (6,10), (10,14), (14,22), (22,26), (26,34), ... . Removing from the set of all primes the last prime of each interval, i.e., 3,5,7,13,19,23,31,... we obtain 2,11,17,29, etc. - Vladimir Shevelev, Aug 30 2011
This sequence and A194598 are the mutually wrapping up sequences:
A194598(1) <= a(1) <= A194598(2) <= a(2) <= ...
From Peter Munn, Oct 30 2017: (Start)
The sequence is the list of primes p = prime(k) such that there are no primes between prime(k)/2 and prime(k+1)/2. Changing "k" to "k-1" and therefore "k+1" to "k" produces a definition very similar to A164333's: it differs by prefixing an initial term 3. From this we get a(n+1) = prevprime(A164333(n)) = A151799(A164333(n)) for n >= 1.
The sequence is the list of primes that are not the largest prime less than 2*prime(k) for any k, so that - as a set - it is the complement relative to A000040 of the set of numbers in A059788.
{{2}, A166252, A166307} is a partition.
(End)

Examples

			2 is in the sequence, since then q=2, and there is a prime 3 between 2 and 4. - _N. J. A. Sloane_, Oct 15 2009
		

Crossrefs

Cf. Ramanujan primes, A104272, and related sequences: A164288, A080359, A164294, A193507, A194184, A194186.
A001359, A166252, A166307 are subsets.
Cf. A001262, A001567, A062568, A141232 (all relate to pseudoprimes to base 2).

Programs

  • Maple
    a:= proc(n) option remember; local q, k, p;
          k:= nextprime(`if`(n=1, 1, a(n-1)));
          do q:= nextprime(floor(k/2));
             p:= nextprime(k);
             if p<2*q then break fi;
             k:= p
          od; k
        end:
    seq(a(n), n=1..55);  # Alois P. Heinz, Aug 30 2011
  • Mathematica
    Reap[Do[q=NextPrime[p/2]; If[PrimePi[2*q] != PrimePi[p], Sow[p]], {p, Prime[Range[100]]}]][[2, 1]]
    (* Second program: *)
    fQ[n_] := PrimePi[ 2NextPrime[n/2]] != PrimePi[n];
    Select[ Prime@ Range@ 105, fQ]
  • PARI
    is(n)=nextprime(n+1)<2*nextprime(n/2) && isprime(n) \\ Charles R Greathouse IV, Apr 24 2015

Formula

As a set, this sequence = A000040 \ A059788 = A000040 \ prevprime(2*A000040) = A000040 \ A151799(A005843(A000040)). - Peter Munn, Oct 30 2017

Extensions

Definition clarified and simplified by Jonathan Sondow, Oct 25 2011

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

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

A174635 Prime numbers that are not Ramanujan primes.

Original entry on oeis.org

3, 5, 7, 13, 19, 23, 31, 37, 43, 53, 61, 73, 79, 83, 89, 103, 109, 113, 131, 137, 139, 157, 163, 173, 191, 193, 197, 199, 211, 223, 251, 257, 271, 277, 283, 293, 313, 317, 331, 337, 353, 359, 379, 383, 389, 397, 421, 443, 449, 457, 463, 467, 479, 499, 509, 521
Offset: 1

Views

Author

T. D. Noe, Nov 29 2010

Keywords

Comments

Complement of A104272 in the primes. Not the same as A059788.
Also known as non-Ramanujan Primes. - John W. Nicholson, Jan 29 2012

Crossrefs

Cf. A104272.

Programs

A164917 Smallest number of steps to reach prime(n) by applying the map x->A060308(x) starting from any member of A164368.

Original entry on oeis.org

0, 1, 2, 3, 0, 4, 0, 1, 5, 0, 1, 2, 0, 6, 0, 1, 0, 2, 0, 0, 3, 1, 7, 1, 0, 0, 2, 0, 0, 1, 0, 1, 0, 1, 0, 0, 2, 8, 0, 2, 0, 0, 0, 1, 0, 1, 1, 2, 0, 0, 0, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 0, 0, 3, 9, 1, 3, 0, 0, 1, 1, 0, 0, 1, 2, 1, 2, 0, 0, 0, 2, 0, 0, 0, 3, 1, 1, 0, 1, 1, 1, 0, 0, 2, 0, 3, 0, 1, 2, 3, 1, 1, 0, 0, 2
Offset: 1

Views

Author

Vladimir Shevelev, Aug 31 2009

Keywords

Comments

Starting from some prime, iterated application of A060308 (or of the equivalent A059788) generates a chain of increasing prime numbers.
The nature of these chains is to reach higher in the list of primes, sometimes "over-satisfying" Bertrand's postulate by skipping some nearer primes, almost doubling of possible. On the other hand, A164368 contains the primes that would be skipped by a chain which contains the prime slightly above half of their value. The sequence shows how far up in chains starting from some member of A164368 we find prime(n), or equivalently, how many inverse applications of the map we need to hit a member of A164368 if starting at prime(n).
Note that by construction A164368(k) starts with the smallest prime that is not member of any chain started from any previous A164368. So each prime exists at some place in one of these chains, and the number of steps a(n) to reach it from the start of its chain is well defined.

Examples

			The first prime chains of the mapping with A060308 initialized with members of A164368 are
2->3->5->7->13->23->43->83->163->317->631->1259->2503->..
11->19->37->73->139->277->547->1093->2179->4357->8713->17419->..
17->31->61->113->223->443->883->1759->3517->7027->14051->28099->..
29->53->103->199->397->787->1571->3137->6271->12541->25073->..
41->79->157->313->619->1237->2473->4943->9883->19763->39521->..
47->89->173->337->673->1327->2647->5281->10559->21107->..
The a(1) to a(4) representing the first 4 primes are all on the first chain, and need 0 to 3 steps to be reached from 2 = A164368(1). a(5) asks for the number of steps for A000040(5)=11 which is on the second chain, and needs 0 steps.
		

Crossrefs

Programs

  • Maple
    A060308 := proc(n) prevprime(2*n+1) ; end:
    isA164368 := proc(p) local q ; q := nextprime(floor(p/2)) ; RETURN(numtheory[pi](2*q) -numtheory[pi](p) >= 1); end:
    A164368 := proc(n) option remember; local a; if n = 1 then 2; else a := nextprime( procname(n-1)) ; while not isA164368(a) do a := nextprime(a) ; od: RETURN(a) ; fi; end:
    A164917 := proc(n) local p,a,j,q,itr ; p := ithprime(n) ; a := 1000000000000000 ; for j from 1 do q := A164368(j) ; if q > p then break; fi; itr := 0 ; while q < p do q := A060308(q) ; itr := itr+1 ; od; if q = p then if itr < a then a := itr; fi; fi; od: a ; end:
    seq(A164917(n),n=1..120) ; # R. J. Mathar, Sep 24 2009
  • Mathematica
    A060308[n_] := NextPrime[2*n + 1, -1];
    isA164368[p_] := Module[{q}, q = NextPrime[Floor[p/2]]; Return[PrimePi[2*q] - PrimePi[p] >= 1]];
    A164368[n_] := A164368[n] = Module[{a}, If[n == 1, 2, a = NextPrime[ A164368[n-1]]; While[Not @ isA164368[a], a = NextPrime[a]]; Return[a]]];
    A164917[n_] := Module[{p, a, j, q, itr}, p = Prime[n]; a = 10^15; For[j = 1 , True, j++, q = A164368[j]; If[q > p, Break[]]; itr = 0; While[q < p, q = A060308[q]; itr++]; If[q == p, If[itr < a, a = itr]]]; a];
    Table[A164917[n], {n, 1, 120}] (* Jean-François Alcover, Dec 14 2017, after R. J. Mathar *)

Extensions

Edited, examples added and extended by R. J. Mathar, Sep 24 2009

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.

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

A370008 a(n) is the greatest prime less than 3*prime(n).

Original entry on oeis.org

5, 7, 13, 19, 31, 37, 47, 53, 67, 83, 89, 109, 113, 127, 139, 157, 173, 181, 199, 211, 211, 233, 241, 263, 283, 293, 307, 317, 317, 337, 379, 389, 409, 409, 443, 449, 467, 487, 499, 509, 523, 541, 571, 577, 587, 593, 631, 661, 677, 683, 691, 709, 719, 751
Offset: 1

Views

Author

Clark Kimberling, Feb 09 2024

Keywords

Examples

			5 < 3*2 < 7 < 3*3 < 11 < 13 < 3*5, so (a(1), a(2), a(3)) = (5,7,13).
		

Crossrefs

Programs

  • Mathematica
    Table[Prime[PrimePi[3*Prime[n]]], {n,1,200}]
  • PARI
    a(n) = precprime(3*prime(n)); \\ Michel Marcus, Feb 10 2024

A060271 Difference between smallest prime following and largest prime preceding 2*(n-th prime).

Original entry on oeis.org

2, 2, 4, 4, 4, 6, 6, 4, 4, 6, 6, 6, 4, 6, 8, 4, 14, 14, 6, 10, 10, 6, 4, 6, 4, 12, 12, 12, 12, 4, 6, 6, 6, 4, 14, 14, 4, 14, 6, 10, 6, 8, 4, 6, 8, 4, 10, 6, 8, 4, 4, 12, 8, 4, 12, 18, 18, 6, 10, 6, 6, 10, 4, 12, 12, 10, 12, 4, 10, 10, 8, 10, 6, 8, 4, 8, 14, 10, 12, 10, 10, 14, 4, 14, 4, 4, 20, 8
Offset: 1

Views

Author

Labos Elemer, Mar 23 2001

Keywords

Examples

			For n = 1: prime(1) = 2, 2*prime(1) = 4 is between 3 and 5, their difference is 2 = a(1).
For n = 6: prime(6) = 13, 2*prime(6) = 26 is between 23 and 29 and their difference is 6 = a(6).
		

Crossrefs

Programs

  • Maple
    with(numtheory): [seq(nextprime(2*ithprime(j))-prevprime(2*ithprime(j)),j=1...256)];
  • Mathematica
    dsplp[n_]:=Module[{np=2Prime[n]},NextPrime[np]-NextPrime[np,-1]]; Array[ dsplp,90] (* Harvey P. Dale, Mar 20 2013 *)
  • PARI
    a(n) = {my(m = 2*prime(n)); nextprime(m+1) - precprime(m-1);} \\ Amiram Eldar, Feb 08 2025

Extensions

Offset changed to 1 and a(1) prepended by Amiram Eldar, Feb 08 2025
Showing 1-10 of 13 results. Next