login
Smallest prime that begins a run of n Ramanujan primes that are consecutive primes.
6

%I #36 Jun 04 2019 06:22:58

%S 2,67,227,227,227,2657,2657,2657,2657,2657,2657,2657,2657,562871,

%T 793487,809707,809707,984241,984241,984241,6234619,11652013,41662651,

%U 41662651,41662651,94653397,383825567,869730887,953913871,953913871,953913871

%N Smallest prime that begins a run of n Ramanujan primes that are consecutive primes.

%C The first run of 13 consecutive Ramanujan primes was mentioned by Sondow.

%C Starting at index m = A191228(a(n)) in A190874(m), the first instance of a count of n - 1 consecutive 1's is seen. - _John W. Nicholson_, Dec 15 2011

%H Dana Jacobsen, <a href="/A174602/b174602.txt">Table of n, a(n) for n = 1..42</a>

%H J. Sondow, <a href="http://arxiv.org/abs/0907.5232">Ramanujan primes and Bertrand's postulate</a>, arXiv:0907.5232 [math.NT], 2009-2010.

%H J. Sondow, <a href="https://www.jstor.org/stable/40391170">Ramanujan primes and Bertrand's postulate</a>, Amer. Math. Monthly, 116 (2009) 630-635.

%H J. Sondow, J. W. Nicholson, and T. D. Noe, <a href="https://arxiv.org/abs/1105.2249">Ramanujan Primes: Bounds, Runs, Twins, and Gaps</a>, arXiv:1105.2249 [math.NT], 2011.

%H J. Sondow, J. W. Nicholson, and T. D. Noe, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL14/Noe/noe12.html">Ramanujan Primes: Bounds, Runs, Twins, and Gaps</a>, J. Integer Seq. 14 (2011) Article 11.6.2.

%e 67 and 71 are the first two Ramanujan primes that are consecutive primes, so a(2) = 67.

%t nn=10000; t=Table[0, {nn}]; len=Prime[3*nn]; s=0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s<nn, t[[s+1]]=k], {k, len}]; t=t+1;ind=PrimePi[t]; d=Differences[ind]; cnt=0; n=1; Join[{2}, Reap[Do[If[d[[i]]==1, cnt++; If[cnt==n, Sow[t[[i-n+1]]]; n++], cnt=0], {i, Length[d]}]][[2, 1]]]

%o (Perl) use ntheory ":all"; my $r=ramanujan_primes(1e8); my $max = 0; for (0..$#$r-2) { my $k=0; $k++ while next_prime($r->[$_+$k]) == $r->[$_+$k+1]; say ++$max," ",$r->[$_] while $k >= $max; } # _Dana Jacobsen_, Jul 14 2016

%Y Cf. A104272 (Ramanujan primes), A174641 (runs of non-Ramanujan primes).

%K nonn

%O 1,1

%A _T. D. Noe_, Nov 29 2010