OFFSET
1,1
EXAMPLE
a(4) = 59 because the next prime-indexed prime after 41 is 59, and that is a record gap of size 18.
MATHEMATICA
Function[s, Function[t, Flatten@ Map[s[[First@ Position[t, #] + 1]] &, Union@ Rest@ FoldList[Max, 0, t]]]@ Differences@ s]@ Array[Prime@ Prime@ # &, 10^5] (* Michael De Vlieger, Dec 25 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Bobby Jacobs, Dec 25 2016
STATUS
approved