OFFSET
0,5
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..11000
MATHEMATICA
a[n_] := If[n<1, 0, Block[{k=1}, While[Prime[n + k - 1] > Prime[k]^2, k++]; k - 1]]; Table[a[n], {n, 0, 130}] (* Indranil Ghosh, Mar 24 2017 *)
PROG
(PARI) A284263(n) = { my(k=1); if(0==n, 0, while(prime(n+k-1) > (prime(k)^2), k = k+1); (k-1)); };
(Python)
from sympy import prime
def a(n):
if n<1: return 0
k=1
while prime(n + k - 1)>prime(k)**2:k+=1
return k - 1 # Indranil Ghosh, Mar 24 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 24 2017
STATUS
approved