A182451 Numbers of A166252 which are not in A164554.
109, 151, 191, 229, 233, 283, 311, 571, 643, 683, 727, 941, 991, 1033, 1051, 1373, 1493, 1667, 1697, 1741, 1747, 1783, 1787, 1801, 1931
Offset: 1
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.
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]
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
(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 *)
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
use ntheory ":all"; my $r = ramanujan_primes(1000); say "[@$r]"; # Dana Jacobsen, Sep 06 2015
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
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 *)
a(n) = {my(x = 1); while ((primepi(x) - primepi(x\2)) != n, x++;); x;} \\ Michel Marcus, Jan 15 2014
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
Let p=53. We see that 2*23<53<2*29. Since the interval (46, 58) contains prime 47<53 and does not contain any prime more than 53, then, by the considered classification 53 is left prime and it is in the sequence. [_Vladimir Shevelev_, Oct 10 2009]
isA164333 := proc(n) local i ; if isprime(n) and n > 3 then for i from (prevprime(n)+1)/2 to (n-1)/2 do if isprime(i) then return false; end if; end do; return true; else false; end if; end proc: for i from 2 to 700 do if isA164333(i) then printf("%d,",i); end if; end do: # R. J. Mathar, Oct 29 2011
kmax = 200; Select[Table[{(Prime[k - 1] + 1)/2, (Prime[k] - 1)/2}, {k, 3, kmax}], AllTrue[Range[#[[1]], #[[2]]], CompositeQ]&][[All, 2]]*2 + 1 (* Jean-François Alcover, Nov 14 2017 *)
Since 2*31 < 71 < 2*37 and the interval (62, 74) contains prime 67 < 71 and prime 73 > 71, then 71 is in the sequence.
n = 0; t = {}; While[Length[t] < 100, n++; ps = Select[Range[2*Prime[n], 2*Prime[n+1]], PrimeQ]; If[Length[ps] > 2, t = Join[t, Rest[Most[ps]]]]]; t (* T. D. Noe, Apr 30 2012 *)
For p=29 we have: 2*13 < 29 < 2*17 and interval (26, 29) is free from primes while interval (29, 34) contains a prime. Therefore 29 is in the sequence for k=6.
f[n_] := Block[{t = Select[ Table[i, {i, 2 Prime[n], 2 Prime[n + 1]}], PrimeQ]}, If[ Length@ t > 1, t[[1]], 0]]; Rest@ Union@ Array[f, 115] (* Robert G. Wilson v, May 08 2011 *)
nn = 1000; A001359 = Select[Prime[Range[2 nn]], PrimeQ[# + 2] &]; 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[3 nn]}]; A104272 = R + 1; Complement[A001359, A104272] (* Jean-François Alcover, Oct 28 2018, after T. D. Noe in A104272 *)
use ntheory ":all"; for (@{twin_primes(1e4)}) { say if !is_ramanujan_prime($) } # _Dana Jacobsen, Dec 30 2015
For k=6 we have 2*13 < 29 < 31 < 2*17, and the interval contains two primes. Therefore 31 is in the sequence.
n = 0; t = {}; While[Length[t] < 100, n++; ps = Select[Range[2*Prime[n], 2*Prime[n + 1]], PrimeQ]; If[Length[ps] >= 2, AppendTo[t, ps[[-1]]]]]; t (* T. D. Noe, Apr 30 2012 *)
Let n=5, p_5=11; p=2 is not suitable, since in (1,5.5) we have 3 primes, while in (2,11] there are 4 primes. Consider p=3. Now in intervals (1.5,5.5) and (3,11] we have the same number (3) of primes. Therefore, a(5)=3. The same value we can obtain by the formula. Since 11 is not a Labos prime, then a(5)=A080359(5-pi(5.5))=A080359(2)=3.
terms = 60; nn = Prime[terms]; 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[3 nn]}]; A104272 = R + 1; 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]}]; A080359 = Rest[t]; a[n_] := Module[{}, pn = Prime[n]; If[MemberQ[A104272, pn] && MemberQ[ A080359, pn], Return[0]]; For[p = 2, True, p = NextPrime[p], Which[ppn, If[PrimePi[p/2] - PrimePi[pn/2] == PrimePi[p] - PrimePi[pn], Return[p]]]]]; Array[a, terms] (* Jean-François Alcover, Dec 04 2018, after T. D. Noe in A104272 *)
Let n=4, p_n=7. Since 7 is not Ramanujan prime, then a(4) = A104272(4-pi(3.5)) = A104272(2) = 11.
Comments