OFFSET
2,1
COMMENTS
The limit of a(n) as n goes to infinity is infinity.
Conjectures: (1) If q is the nearest prime>a(n), then q-a(n)=4 or 6 and both of these cases occur infinitely many times. (2) If q-a(n)=4 then q is the lesser of twin primes.
Thus, if the conjectures are true, then there exist infinitely many triples of primes of the form {p,p+4,p+6}.
MATHEMATICA
bPrime=Select[Table[Prime[n], {n, 1000000}], Mod[#, 3]==1&]; (*A002476*)
binarySearch[lst_, find_]:=Module[{lo=1, up=Length[lst], v}, (While[lo<=up, v=Floor[(lo+up)/2]; If[lst[[v]]-find==0, Return[v]]; If[lst[[v]]<find, lo=v+1, up=v-1]]; 0)];
bPrimeQ[n_]:=binarySearch[bPrime, n];
nextBPrime[n_, offset_Integer:1]:=bPrime[[bPrimeQ[NextPrime[n, NestWhile[#1+1&, 1, !bPrimeQ[NextPrime[n, #1]]>0&]]]+offset-1]];
z=1; (*example for "contains exactly ONE b-
primes"*)Table[bPrime[[NestWhile[#1+1&, 1, !((nextBPrime[n bPrime[[#1]], z]<n bPrime[[#1+1]]&&nextBPrime[n bPrime[[#1]], z+1]>n bPrime[[#1+1]]))&]]], {n, 2, 20}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev and Peter J. C. Moses, Jan 22 2013
STATUS
approved