# Counting Ramanujan Primes

The Ramanujan primes can be easily plotted with the following code

       l = Table[PrimePi[x] - PrimePi[x/2], {x, 10^4}];

ListLinePlot[1 + Last[Position[l, #]][[1]] & /@ Range[0, 50]]


that is

I would like to plot a counting function for the Ramanujan primes, that is a prime counting function for the Ramanujan primes. Is it possible? Any ideas?

Clear["Global*"]

l = Table[PrimePi[x] - PrimePi[x/2], {x, 10^4}];

ramPrime = 1 + Last[Position[l, #]][[1]] & /@ Range[0, 50];

ramPrimePi[x_] := Count[ramPrime, _?(# <= x &)]


Using Plot

Manipulate[
Plot[ramPrimePi[x], {x, 0, xmax},
Ticks -> {If[xmax < 100, ramPrime[[1 ;; 10]], Automatic], Automatic},
PlotPoints -> {xmax, Automatic}],
{{xmax, 100}, 25, Ceiling[ramPrime[[-1]], 25], 25, Appearance -> "Labeled"}]


Manipulate[
Module[{primes = ramPrime[[1 ;; ramPrimePi[xmax]]]},
ListStepPlot[
Transpose@{{0, primes} // Flatten, Range[0, Length@primes]},
PlotRange -> {{0, xmax}, Automatic},
Ticks -> {If[xmax < 100, ramPrime[[1 ;; 10]], Automatic], Automatic}]],
{{xmax, 100}, 25, Ceiling[ramPrime[[-1]], 25], 25, Appearance -> "Labeled"}]
`