OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
EXAMPLE
28 is in the list because 23 is the greatest prime less than 28 and 28 - 23 = 5 is also prime.
MAPLE
a:= proc(n) option remember; local k;
for k from `if`(n=1, 4, a(n-1)+2) by 2
while not isprime(k-prevprime(k)) do od; k
end:
seq(a(n), n=1..60); # Alois P. Heinz, Mar 03 2014
MATHEMATICA
Select[Range[99] 2, PrimeQ[# - NextPrime[#, -1]] &] (* Giovanni Resta, Feb 22 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Franz Vrabec, Feb 20 2014
STATUS
approved