OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
18 is in the sequence, since r(18) = 1 < 2 = r(9); 22 is not in the sequence, since r(22) = 1 >= 0 = r(11).
PROG
(PARI) r(n)=min(nextprime(n)-n, n-precprime(n))
forstep(k=2, 1e3, 2, if(r(k)<r(k/2), print1(k", "))) \\ Charles R Greathouse IV, Jul 31 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Jul 31 2011
STATUS
approved