A290541 Record gaps between numbers that are either prime or twice a prime.
1, 3, 6, 10, 11, 12, 13, 15, 19, 21, 25, 28, 35, 40, 48, 57, 60, 64, 70, 75, 83, 90, 95, 117, 120, 144, 148, 150, 153, 167, 168, 196, 205, 212, 214, 221, 234, 244, 254, 255
Offset: 1
Examples
a(3) = 6 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.
Programs
-
Mathematica
With[{nn = 10^7}, Union@ FoldList[Max, Differences@ #] &@ Union@ Flatten@ {#, 2 TakeWhile[#, # < Prime[nn]/2 &]} &@ Prime@ Range@ nn] (* Michael De Vlieger, Aug 06 2017 *)
Extensions
a(36)-a(40) from Giovanni Resta, Aug 06 2017
Comments