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

A164960 The minimum number of steps needed to generate prime(n) under the map x -> A060264(x) starting from any x taken from {2,3} or from A164333.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Sep 02 2009

Keywords

Examples

			a(3) = 1 because prime(3)=5 can be generated in 1 step starting from x=2.
a(4) = 1 because prime(4)=7 can be generated in 1 step starting from x=3.
		

Crossrefs

Cf. A164333.

Programs

  • Maple
    # include source from A164333 and A060264 here
    A164333 := proc(n)
            if n = 1 then
                    13;
            else
                    for a from procname(n-1)+1 do
                            if isA164333(a) then
                                    return a;
                            end if;
                    end do;
            end if;
    end proc:
    A164960aux := proc(p,strt)
            local a,x;
            if strt > p then
                    return 1000000000;
            end if;
            a := 0 ;
            x := strt ;
            while x < p do
                    x := A060264(x) ;
                    a := a+1 ;
            end do;
            if x = p then
                    return a ;
            else
                    return 1000000000;
            end if;
    end proc:
    A164960 := proc(n)
            local p,a,strt,i;
            p := ithprime(n) ;
            a := A164960aux(p,2) ;
            a := min(a,A164960aux(p,3)) ;
            for i from 1 do
                    strt := A164333(i) ;
                    if strt > p then
                            return a;
                    else
                            a := min(a, A164960aux(p,strt)) ;
                    end if;
            end do:
            return a;
    end proc:
    seq(A164960(n),n=1..90) ; # R. J. Mathar, Oct 29 2011
  • Mathematica
    nmax = 100; kmax = nmax + 5;
    A164333 = Select[Table[{(Prime[k - 1] + 1)/2, (Prime[k] - 1)/2}, {k, 3, kmax}], AllTrue[Range[#[[1]], #[[2]]], CompositeQ] &][[All, 2]]*2 + 1;
    A164960aux[p_, strt_] := Module[{a, x}, If[strt > p, Return[10^9]]; a = 0; x = strt; While[x < p, x = NextPrime[2 x]; a++]; If[x == p, Return[a], Return[10^9]]];
    A164960[n_] := Module[{p, a, strt, i}, p = Prime[n]; a = A164960aux[p, 2]; a = Min[a, A164960aux[p, 3]]; For[i = 1, i < 100, i++, strt = A164333[[i]]; If[strt > p, Return[a], a = Min[a, A164960aux[p, strt]]]]; Return[a]];
    Table[A164960[n], {n, 1, nmax}] (* Jean-François Alcover, Dec 13 2017, after R. J. Mathar *)

Extensions

One term corrected, sequence extended, examples added by R. J. Mathar, Oct 29 2011

A164962 a(n) is the least prime from the union {2,3} and A164333, beginning with which the n-th prime p_n is obtained by some number of iterations of the S operator g(see A164960).

Original entry on oeis.org

2, 3, 2, 3, 2, 13, 3, 19, 2, 13, 31, 3, 19, 43, 2, 53, 13, 61, 31, 71, 73, 3, 19, 43, 2, 101, 103, 53, 109, 113, 13, 131, 31
Offset: 1

Views

Author

Vladimir Shevelev, Sep 02 2009

Keywords

Comments

The sequence is connected with our sieve selecting the primes of the union {2,3} and A164333 from all primes. Note that a(n)=n iff p_n is in the considered union, which corresponds to 0's iterations of g.

Crossrefs

A164966 Primes which are obtained at least by two ways using the iterations of the S operator (see A164960) beginning with primes of the union of {2,3} and A164333.

Original entry on oeis.org

127, 149, 211, 223, 257, 307, 431, 449
Offset: 1

Views

Author

Vladimir Shevelev, Sep 02 2009

Keywords

Comments

The sequence is connected with our sieve selecting the primes of the union of {2,3} and A164333 from all primes.

Crossrefs

A104272 Ramanujan primes R_n: a(n) is the smallest number such that if x >= a(n), then pi(x) - pi(x/2) >= n, where pi(x) is the number of primes <= x.

Original entry on oeis.org

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

Views

Author

Jonathan Sondow, Feb 27 2005

Keywords

Comments

Referring to his proof of Bertrand's postulate, Ramanujan (1919) states a generalization: "From this we easily deduce that pi(x) - pi(x/2) >= 1, 2, 3, 4, 5, ..., if x >= 2, 11, 17, 29, 41, ..., respectively." Since the a(n) are prime (by their minimality), I call them "Ramanujan primes."
See the additional references and links mentioned in A143227.
2n log 2n < a(n) < 4n log 4n for n >= 1, and prime(2n) < a(n) < prime(4n) if n > 1. Also, a(n) ~ prime(2n) as n -> infinity.
Shanta Laishram has proved that a(n) < prime(3n) for all n >= 1.
a(n) - 3n log 3n is sometimes positive, but negative with increasing frequency as n grows since a(n) ~ 2n log 2n. There should be a constant m such that for n >= m we have a(n) < 3n log 3n.
A good approximation to a(n) = R_n for n in [1..1000] is A162996(n) = round(k*n * (log(k*n)+1)), with k = 2.216 determined empirically from the first 1000 Ramanujan primes, which approximates the {k*n}-th prime number which in turn approximates the n-th Ramanujan prime and where abs(A162996(n) - R_n) < 2 * sqrt(A162996(n)) for n in [1..1000]. Since R_n ~ prime(2n) ~ 2n * (log(2n)+1) ~ 2n * log(2n), while A162996(n) ~ prime(k*n) ~ k*n * (log(k*n)+1) ~ k*n * log(k*n), A162996(n) / R_n ~ k/2 = 2.216/2 = 1.108 which implies an asymptotic overestimate of about 10% (a better approximation would need k to depend on n and be asymptotic to 2). - Daniel Forgues, Jul 29 2009
Let p_n be the n-th prime. If p_n >= 3 is in the sequence, then all integers (p_n+1)/2, (p_n+3)/2, ..., (p_(n+1)-1)/2 are composite numbers. - Vladimir Shevelev, Aug 12 2009
Denote by q(n) the prime which is the nearest from the right to a(n)/2. Then there exists a prime between a(n) and 2q(n). Converse, generally speaking, is not true, i.e., there exist primes outside the sequence, but possess such property (e.g., 109). - Vladimir Shevelev, Aug 14 2009
The Mathematica program FasterRamanujanPrimeList uses Laishram's result that a(n) < prime(3n).
See sequence A164952 for a generalization we call a Ramanujan k-prime. - Vladimir Shevelev, Sep 01 2009
From Jonathan Sondow, May 22 2010: (Start)
About 46% of primes < 19000 are Ramanujan primes. About 78% of the lesser of twin primes < 19000 are Ramanujan primes.
About 15% of primes < 19000 are the lesser of twin primes. About 26% of Ramanujan primes < 19000 are the lesser of twin primes.
A reason for the jumps is in Section 7 of "Ramanujan primes and Bertrand's postulate" and in Section 4 of "Ramanujan Primes: Bounds, Runs, Twins, and Gaps". (See the arXiv link for a corrected version of Table 1.)
See Shapiro 2008 for an exposition of Ramanujan's proof of his generalization of Bertrand's postulate. (End)
The (10^n)-th R prime: 2, 97, 1439, 19403, 242057, 2916539, 34072993, 389433437, .... - Robert G. Wilson v, May 07 2011, updated Aug 02 2012
The number of R primes < 10^n: 1, 10, 72, 559, 4459, 36960, 316066, 2760321, .... - Robert G. Wilson v, Aug 02 2012
a(n) = R_n = R_{0.5,n} in "Generalized Ramanujan Primes."
All Ramanujan primes are in A164368. - Vladimir Shevelev, Aug 30 2011
If n tends to infinity, then limsup(a(n) - A080359(n-1)) = infinity; conjecture: also limsup(a(n) - A080359(n)) = infinity (cf. A182366). - Vladimir Shevelev, Apr 27 2012
Or the largest prime x such that the number of primes in (x/2,x] equals n. This equivalent definition underlines an important analogy between Ramanujan and Labos primes (cf. A080359). - Vladimir Shevelev, Apr 29 2012
Research questions on R_n - prime(2n) are at A233739, and on n-Ramanujan primes at A225907. - Jonathan Sondow, Dec 16 2013
The questions on R_n - prime(2n) in A233739 have been answered by Christian Axler in "On generalized Ramanujan primes". - Jonathan Sondow, Feb 13 2014
Srinivasan's Lemma (2014): prime(k-n) < prime(k)/2 if R_n = prime(k) and n > 1. Proof: By the minimality of R_n, the interval (prime(k)/2,prime(k)] contains exactly n primes and so prime(k-n) < prime(k)/2. - Jonathan Sondow, May 10 2014
For some n and k, we see that A168421(k) = a(n) so as to form a chain of primes similar to a Cunningham chain. For example (and the first example), A168421(2) = 7, links a(2) = 11 = A168421(3), links a(3) = 17 = A168421(4), links a(4) = 29 = A168421(6), links a(6) = 47. Note that the links do not have to be of a form like q = 2*p+1 or q = 2*p-1. - John W. Nicholson, Feb 22 2015
Extending Sondow's 2010 comments: About 48% of primes < 10^9 are Ramanujan primes. About 76% of the lesser of twin primes < 10^9 are Ramanujan primes. - Dana Jacobsen, Sep 06 2015
Sondow, Nicholson, and Noe's 2011 conjecture that pi(R_{m*n}) <= m*pi(R_n) for m >= 1 and n >= N_m (see A190413, A190414) was proved for n > 10^300 by Shichun Yang and Alain Togbé in 2015. - Jonathan Sondow, Dec 01 2015
Berliner, Dean, Hook, Marr, Mbirika, and McBee (2016) prove in Theorem 18 that the graph K_{m,n} is prime for n >= R_{m-1}-m; see A291465. - Jonathan Sondow, May 21 2017
Okhotin (2012) uses Ramanujan primes to prove Lemma 8 in "Unambiguous finite automata over a unary alphabet." - Jonathan Sondow, May 30 2017
Sepulcre and Vidal (2016) apply Ramanujan primes in Remark 9 of "On the non-isolation of the real projections of the zeros of exponential polynomials." - Jonathan Sondow, May 30 2017
Axler and Leßmann (2017) compute the first k-Ramanujan prime for k >= 1 + epsilon; see A277718, A277719, A290394. - Jonathan Sondow, Jul 30 2017

Examples

			a(1) = 2 is Bertrand's postulate: pi(x) - pi(x/2) >= 1 for all x >= 2.
a(2) = 11 because a(2) < 8 log 8 < 17 and pi(n) - pi(n/2) > 1 for n = 16, 15, ..., 11 but pi(10) - pi(5) = 1.
Consider a(9)=71. Then the nearest prime > 71/2 is 37, and between a(9) and 2*37, that is, between 71 and 74, there exists a prime (73). - _Vladimir Shevelev_, Aug 14 2009 [corrected by _Jonathan Sondow_, Jun 17 2013]
		

References

  • Srinivasa Ramanujan, Collected Papers of Srinivasa Ramanujan (Ed. G. H. Hardy, S. Aiyar, P. Venkatesvara and B. M. Wilson), Amer. Math. Soc., Providence, 2000, pp. 208-209.
  • Harold N. Shapiro, Ramanujan's idea, Section 9.3B in Introduction to the Theory of Numbers, Dover, 2008.

Crossrefs

Cf. A006992 (Bertrand primes), A056171 (pi(n) - pi(n/2)).
Cf. A162996 (Round(kn * (log(kn)+1)), with k = 2.216 as an approximation of R_n = n-th Ramanujan Prime).
Cf. A163160 (Round(kn * (log(kn)+1)) - R_n, where k = 2.216 and R_n = n-th Ramanujan prime).
Cf. A178127 (Lesser of twin Ramanujan primes), A178128 (Lesser of twin primes if it is a Ramanujan prime).
Cf. A181671 (number of Ramanujan primes less than 10^n).
Cf. A174635 (non-Ramanujan primes), A174602, A174641 (runs of Ramanujan and non-Ramanujan primes).
Cf. A189993, A189994 (lengths of longest runs).
Cf. A190124 (constant of summation: 1/a(n)^2).
Cf. A192820 (2- or derived Ramanujan primes R'_n), A192821, A192822, A192823, A192824, A225907.
Cf. A193761 (0.25-Ramanujan primes), A193880 (0.75-Ramanujan primes).
Cf. A185004 - A185007 ("modular" Ramanujan primes).
Not to be confused with the Ramanujan numbers or Ramanujan tau function, A000594.

Programs

  • Maple
    A104272 := proc(n::integer)
        local R;
        if n = 1 then
            return 2;
        end if;
        R := ithprime(3*n-1) ; # upper limit Laishram's thrm Thrm 3 arXiv:1105.2249
        while true do
            if A056171(R) = n then # Defn. 1. of Shevelev JIS 14 (2012) 12.1.1
                return R ;
            end if;
            R := prevprime(R) ;
        end do:
    end proc:
    seq(A104272(n),n=1..200) ; # slow downstream search <= p(3n-1) R. J. Mathar, Sep 21 2017
  • Mathematica
    (RamanujanPrimeList[n_] := With[{T=Table[{k,PrimePi[k]-PrimePi[k/2]}, {k,Ceiling[N[4*n*Log[4*n]]]}]}, Table[1+First[Last[Select[T,Last[ # ]==i-1&]]],{i,1,n}]]; RamanujanPrimeList[54]) (* Jonathan Sondow, Aug 15 2009 *)
    (FasterRamanujanPrimeList[n_] := With[{T=Table[{k,PrimePi[k]-PrimePi[k/2]}, {k,Prime[3*n]}]}, Table[1+First[Last[Select[T,Last[ # ]==i-1&]]],{i,1,n}]]; FasterRamanujanPrimeList[54])
    nn=1000; R=Table[0,{nn}]; s=0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[sT. D. Noe, Nov 15 2010 *)
  • PARI
    ramanujan_prime_list(n) = {my(L=vector(n), s=0, k=1); for(k=1, prime(3*n)-1, if(isprime(k), s++); if(k%2==0 && isprime(k/2), s--); if(sSatish Bysany, Mar 02 2017
  • Perl
    use ntheory ":all"; my $r = ramanujan_primes(1000); say "[@$r]"; # Dana Jacobsen, Sep 06 2015
    

Formula

a(n) = 1 + max{k: pi(k) - pi(k/2) = n - 1}.
a(n) = A080360(n-1) + 1 for n > 1.
a(n) >= A080359(n). - Vladimir Shevelev, Aug 20 2009
A193761(n) <= a(n) <= A193880(n).
a(n) = 2*A084140(n) - 1, for n > 1. - Jonathan Sondow, Dec 21 2012
a(n) = prime(2n) + A233739(n) = (A233822(n) + a(n+1))/2. - Jonathan Sondow, Dec 16 2013
a(n) = max{prime p: pi(p) - pi(p/2) = n} (see Shevelev 2012). - Jonathan Sondow, Mar 23 2016
a(n) = A000040(A179196(n)). - R. J. Mathar, Sep 21 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = A190303. - Amiram Eldar, Nov 20 2020

A080359 The smallest integer x > 0 such that the number of primes in (x/2, x] equals n.

Original entry on oeis.org

2, 3, 13, 19, 31, 43, 53, 61, 71, 73, 101, 103, 109, 113, 139, 157, 173, 181, 191, 193, 199, 239, 241, 251, 269, 271, 283, 293, 313, 349, 353, 373, 379, 409, 419, 421, 433, 439, 443, 463, 491, 499, 509, 523, 577, 593, 599, 601, 607, 613, 619, 647, 653, 659
Offset: 1

Views

Author

Labos Elemer, Feb 21 2003

Keywords

Comments

a(n) is the same as: Smallest integer x > 0 such that the number of unitary-prime-divisors of x! equals n.
Let p_n be the n-th prime. If p_n>3 is in the sequence, then all integers (p_n-1)/2, (p_n-3)/2, ..., (p_(n-1)+1)/2 are composite numbers. - Vladimir Shevelev, Aug 12 2009
For n >= 3, denote by q(n) the prime which is the nearest from the left to a(n)/2. Then there exists a prime between 2q(n) and a(n). The converse, generally speaking, is not true; i.e., there exist primes that are outside the sequence, but possess such property (e.g., 131). - Vladimir Shevelev, Aug 14 2009
See sequence A164958 for a generalization. - Vladimir Shevelev, Sep 02 2009
a(n) is the n-th Labos prime.

Examples

			n=5: in 31! five unitary-prime-divisors appear (firstly): {17,19,23,29,31}, while other primes {2,3,5,7,11,13} are at least squared. Thus a(5)=31.
Consider a(9)=71. Then the nearest prime < 71/2 is q(9)=31, and between 2q(9) and a(9), i.e., between 62 and 71 there exists a prime (67). - _Vladimir Shevelev_, Aug 14 2009
		

Crossrefs

Cf. A104272 (Ramanujan primes).
Cf. A060756, A080360 (largest integer x with n primes in (x/2,x]).

Programs

  • Mathematica
    nn=1000; t=Table[0, {nn+1}]; s=0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s<=nn && t[[s+1]]==0, t[[s+1]]=k], {k, Prime[3*nn]}]; Rest[t]
    (* Second program: *)
    a[1] = 2; a[n_] := a[n] = Module[{x = a[n-1]}, While[(PrimePi[x]-PrimePi[Quotient[x, 2]]) != n, x++ ]; x]; Array[a, 54] (* Jean-François Alcover, Sep 14 2018 *)
  • PARI
    a(n) = {my(x = 1); while ((primepi(x) - primepi(x\2)) != n, x++;); x;} \\ Michel Marcus, Jan 15 2014
    
  • Sage
    def A():
        i = 0; n = 1
        while True:
            p = prime_pi(i) - prime_pi(i//2)
            if p == n:
                yield i
                n += 1
            i += 1
    A080359 = A()
    [next(A080359) for n in range(54)] # Peter Luschny, Sep 03 2014

Formula

a(n) = Min{x; Pi[x]-Pi[x/2]=n} = Min{x; A056171(x)=n}=Min{x; A056169(n!)=n}; where Pi()=A000720().
a(n) <= A193507(n) (cf. A194186). - Vladimir Shevelev, Aug 18 2011

Extensions

Definition corrected by Jonathan Sondow, Aug 10 2008
Shrunk title and moved part of title to comments by John W. Nicholson, Sep 18 2011

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

A164294 Primes prime(k) such that all integers in [(prime(k-1)+1)/2,(prime(k)-1)/2] are composite, excluding those primes in A080359.

Original entry on oeis.org

131, 151, 229, 233, 311, 571, 643, 727, 941, 1013, 1051, 1153, 1373, 1531, 1667, 1669, 1723, 1783, 1787, 1831, 1951, 1979, 2029, 2131, 2213, 2239, 2311, 2441, 2593, 2621, 2633, 2659, 2663, 2887, 3001, 3011, 3019, 3121, 3169, 3209, 3253, 3347, 3413, 3457
Offset: 1

Views

Author

Vladimir Shevelev, Aug 12 2009

Keywords

Comments

The primes of A080359 larger than 3 all have the property that the integers in the interval selected by halving the value of the preceding prime and halving their own value are all composite. This sequence here collects the primes that are not in A080359 but still share this property of the prime-free subinterval.

Examples

			For the prime 1531=A000040(242), the preceding prime is A000040(241)=1523, and the integers from (1523+1)/2 = 762 up to (1531-1)/2 = 765 are all composite, as they fall in the gap between A000040(135) and A000040(136). In addition, 1531 is not in A080359, which adds 1531 to this sequence here.
		

Crossrefs

Programs

  • Mathematica
    maxPrime = 3500;
    kmax = PrimePi[maxPrime];
    A164333 = Select[Table[{(Prime[k - 1] + 1)/2, (Prime[k] - 1)/2}, {k, 3, kmax}], AllTrue[Range[#[[1]], #[[2]]], CompositeQ] &][[All, 2]]*2 + 1;
    b[1] = 2; b[n_] := b[n] = Module[{k = b[n - 1]}, While[(PrimePi[k] - PrimePi[Quotient[k, 2]]) != n, k++]; k];
    A080359 = Reap[For[n = 1, b[n] <= maxPrime, n++, Sow[b[n]]]][[2, 1]];
    Complement[A164333, A080359] (* Jean-François Alcover, Sep 14 2018 *)
  • PARI
    okprime(p) = { my(k = primepi(p)); for (i = (prime(k-1)+1)/2, (prime(k)-1)/2, if (isprime(i), return (0));); return (1);}
    lista(nn) = {vlp = readvec("b080359.txt"); forprime (p=2, nn, if (! vecsearch(vlp, p) && okprime(p), print1(p, ", ")););} \\ Michel Marcus, Jan 15 2014

Formula

Extensions

Extended beyond 571 by R. J. Mathar, Oct 02 2009

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

A194598 Union of A080359 and A164294.

Original entry on oeis.org

2, 3, 13, 19, 31, 43, 53, 61, 71, 73, 101, 103, 109, 113, 131, 139, 151, 157, 173, 181, 191, 193, 199, 229, 233, 239, 241, 251, 269, 271, 283, 293, 311, 313, 349, 353, 373, 379, 409, 419, 421, 433, 439, 443, 463, 491, 499, 509, 523, 571, 577, 593, 599, 601
Offset: 1

Views

Author

Vladimir Shevelev, Aug 30 2011

Keywords

Comments

Every greater of twin primes (A006512), beginning with 13, is in the sequence.
A very simple sieve for the generation of the terms is the following: Let p_n be the n-th prime. Consider consecutive intervals of the form (2p_n, 2p_{n+1}), n=1,2,... From every interval containing at least one prime we take the first one and remove it from the set of all primes. Then all remaining primes form the sequence. Let us demonstrate this sieve: For primes 2,3,5,7,11,... consider intervals (4,6), (6,10), (10,14), (14,22), (22,26), (26,34), ... . Removing from the set of all primes the first prime of each interval, i.e., 5,7,11,17,23,29,... ,we obtain 2,3,13,19,31, etc.
This sequence and A164368 are the mutually wrapping up sequences:
a(1) <= A164368(1) <= a(2) <= A164368(2) <= ...
Following the steps to generate T(n,1) in A229608 provides an alternate method of generating this sequence. - Bob Selcoe, Oct 27 2015

Crossrefs

If the first two terms are omitted we get A164333.

Programs

  • Mathematica
    primePiMax = 200;
    Join[{2, 3}, Select[Table[{(Prime[k-1] + 1)/2, (Prime[k] - 1)/2}, {k, 3, primePiMax}], AllTrue[Range[#[[1]], #[[2]]], CompositeQ]&][[All, 2]]*2+1] (* Jean-François Alcover, Aug 18 2018 *)

Formula

First column of array A229608. - Bob Selcoe, Oct 27 2015
For n >= 3, a(n) = A164333(n-2). - Peter Munn, Aug 30 2017

A164554 Ramanujan primes A104272(n) for which A104272(n) = A080359(n).

Original entry on oeis.org

2, 71, 101, 181, 239, 241, 269, 349, 373, 409, 419, 433, 439, 491, 593, 599, 601, 607, 647, 653, 659, 823, 827, 857, 947, 1021, 1031, 1061, 1063, 1091, 1103, 1301, 1427, 1429, 1447, 1451, 1489, 1553, 1559, 1567, 1601, 1607, 1609, 1789, 1867, 1871, 1913, 1999, 2003
Offset: 1

Views

Author

Vladimir Shevelev, Aug 15 2009

Keywords

Comments

For every n>=1, A104272(n) >= A080359(n), and the sequence shows where the inequality becomes an equality.
Let prime(m) < a(n)/2 < prime(m+1); then there exist primes p
For example, a(2) = 71, 31 < a(2)/2 < 37 and intervals (62,71), (71,74) contain the primes p = 67 and q = 73 respectively.
Let us call a prime p compatible with another prime q, if the intervals (p/2,q/2) and (p,q], if q>p, (or intervals (q/2,p/2) and (q,p], if qVladimir Shevelev, Apr 25 2012]

Examples

			a(2)=71, such that 31<71/2<37, and we see that p=67 is in interval (62, 71) and q=73 is in interval (71, 74).
		

Programs

  • Mathematica
    nn = 200; t = Table[0, {nn+1}]; s = 0;
    Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s <= nn && t[[s+1]] == 0, t[[s+1]] = k], {k, Prime[3nn]}
    ];
    A080359 = Rest[t];
    R = Table[0, {nn}]; s = 0;
    Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s < nn, R[[s+1]] = k], {k, Prime[3nn]}
    ];
    A104272 = R+1;
    Intersection[A104272, A080359] (* Jean-François Alcover, Oct 28 2018, after T. D. Noe in A104272 *)

Formula

All solutions of the equation A104272(x)=A080359(x) are x=pi(a(n))-pi(a(n)/2). - Vladimir Shevelev, Apr 25 2012

Extensions

Terms beyond 659 from R. J. Mathar, Dec 17 2009
Showing 1-10 of 15 results. Next