OFFSET
1,2
COMMENTS
LINKS
Vladimir Shevelev, Ramanujan and Labos primes, their generalizations, and classifications of primes, J. Integer Seq. 15 (2012) Article 12.5.4.
Jonathan Sondow, J. W. Nicholson, and T. D. Noe, Ramanujan Primes: Bounds, Runs, Twins, and Gaps, arXiv:1105.2249 [math.NT], 2011; J. Integer Seq. 14 (2011) Article 11.6.2.
FORMULA
If p_n is not a Labos prime, then a(n) = A080359(n-pi(p_n/2)).
EXAMPLE
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.
MATHEMATICA
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];
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev and Peter J. C. Moses, May 18 2012
STATUS
approved