%I
%S 0,1,1,1,0,1,0,1,1,0,1,1,0,1,0,1,0,1,0,0,1,1,1,1,0,0,1,0,1,2,0,1,1,2,
%T 0,0,1,1,0,1,0,0,1,2,2,3,2,1,0,0,0,0,0,1,1,0,0,1,1,0,1,2,0,0,1,1,1,1,
%U 0,0,1,1,0,0,1,1,1,1,0
%N a(n) = A056171(k)  m, where k=prime(n) and m is the Ramanujan prime index to the greatest Ramanujan prime R(m) <= k.
%C a(n)=0 corresponds to the Ramanujan prime R_m = A104272(m) = A056171(k).
%F a(n) = A056171(k)  m, where k=prime(n) and m is the Ramanujan prime index to the greatest Ramanujan prime R_m = A104272(m) <= k.
%e For prime(30)=113, A056171(113) = 14, 107 is R_12 and 127 is R_13, so 14 12 = 2 (first occurrence).
%o (PARI) \\RR[x] is a list of Ramanujan primes, A104272.
%o {plimit=1.1*10^4;n=s=0;
%o forprime(p=2,plimit,
%o s++;
%o if(p==RR[n+1],n++);
%o print1(sprimepi(floor(p/2))n,", ");
%o )
%o }
%Y Cf. A056171, A104272.
%K nonn
%O 1,30
%A _John W. Nicholson_, Jan 01 2017
