OFFSET
1,3
LINKS
J. Sondow, Ramanujan primes and Bertrand's postulate, Amer. Math. Monthly 116 (2009) 630-635.
J. Sondow, J. W. Nicholson, and T. D. Noe, Ramanujan Primes: Bounds, Runs, Twins, and Gaps, J. Integer Seq. 14 (2011) Article 11.6.2
MATHEMATICA
nn=50000; t=Table[0, {nn}]; s=0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s<nn, t[[s+1]]=k], {k, Prime[3*nn]}]; t=t+1; cnt=0; i=1; Table[While[t[[i]]<10^n, If[t[[i]]+2 == t[[i+1]], cnt++]; i++]; cnt, {n, Floor[Log[10, t[[-1]]]]}]
PROG
(Perl) use ntheory ":all"; for my $n (0..9) { my $r = ramanujan_primes(10**$n); my $t=0; for (0..$#$r-1) { $t++ if $r->[$_+1] - $r->[$_] == 2; } say "$n $t"; } # Dana Jacobsen, Sep 06 2015
CROSSREFS
KEYWORD
nonn,more
AUTHOR
T. D. Noe, Nov 18 2010
EXTENSIONS
a(10)-a(11) from Dana Jacobsen, Apr 29 2015
STATUS
approved