OFFSET
1,1
COMMENTS
The gap between 31397 and 31454 is due to the record prime gap between 31397 and 31469 being almost exactly twice the record prime gap between 15683 and 15727.
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..40
EXAMPLE
a(3) = 53 because the next number that is a prime or twice a prime after 47 is 53, and that is a record gap of size 6.
MATHEMATICA
p = op = 2; r = 0; Reap[While[p < 10^6, p++; If[PrimeQ[p] || PrimeQ[p/2], g = p - op; If[g > r, Sow@p; r = g]; op = p]]][[2, 1]] (* Giovanni Resta, Aug 04 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Bobby Jacobs, Aug 03 2017
EXTENSIONS
a(17)-a(35) from Giovanni Resta, Aug 04 2017
STATUS
approved