OFFSET
1,4
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Abhimanyu Kumar and Anuraag Saxena, Insulated primes, arXiv:2011.14210 [math.NT], 2020. See also Notes Num. Theor. Disc. Math. (2024) Vol. 30, No. 3, 602-612.
MAPLE
f:= p -> min(nextprime(p)-p-1, p-prevprime(p)): f(2):= 0:
map(f@ithprime, [$1..100]); # Robert Israel, Dec 24 2020
MATHEMATICA
{0}~Join~Array[Min[NextPrime[# + 1] - # - 1, # - NextPrime[# - 1, -1]] &@ Prime@ # &, 91, 2] (* Michael De Vlieger, Dec 11 2020 *)
PROG
(PARI)
D(p)={min(nextprime(p+1)-p-1, p-precprime(p-1))}
forprime(p=2, 1000, print1(D(p), ", "))
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Abhimanyu Kumar, Nov 29 2020
STATUS
approved