login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A280379
a(n) = A056171(k) - m, where k=prime(n) and m is the Ramanujan prime index to the greatest Ramanujan prime R(m) <= k.
1
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, 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, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0
OFFSET
1,30
COMMENTS
a(n)=0 corresponds to the Ramanujan prime R_m = A104272(m) = A056171(k).
FORMULA
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.
EXAMPLE
For prime(30)=113, A056171(113) = 14, 107 is R_12 and 127 is R_13, so 14 -12 = 2 (first occurrence).
PROG
(PARI) \\RR[x] is a list of Ramanujan primes, A104272.
{plimit=1.1*10^4; n=s=0;
forprime(p=2, plimit,
s++;
if(p==RR[n+1], n++);
print1(s-primepi(floor(p/2))-n, ", ");
)
}
CROSSREFS
Sequence in context: A219987 A077614 A336396 * A375537 A333307 A180793
KEYWORD
nonn
AUTHOR
John W. Nicholson, Jan 01 2017
STATUS
approved