login
A339270
a(n) is the largest m such that there is no prime except prime(n) from prime(n)-m+1 to prime(n)+m.
1
0, 1, 1, 2, 1, 2, 1, 2, 4, 1, 2, 3, 1, 2, 4, 5, 1, 2, 3, 1, 2, 3, 4, 6, 3, 1, 2, 1, 2, 4, 3, 4, 1, 2, 1, 2, 5, 3, 4, 5, 1, 2, 1, 2, 1, 2, 11, 3, 1, 2, 4, 1, 2, 5, 5, 5, 1, 2, 3, 1, 2, 10, 3, 1, 2, 4, 5, 6, 1, 2, 4, 6, 5, 5, 3, 4, 6, 3, 4, 8, 1, 2, 1, 2, 3, 4, 6, 3, 1, 2, 4, 7
OFFSET
1,4
COMMENTS
For a prime p, the degree of insulation is formally defined as D(p) = Max_{m=1..oo} U where the set U = {m: A000720(p+m) - A000720(p-m) = 1}.
This sequence is employed in defining insulated primes and highly insulated primes.
LINKS
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
Cf. A000040, A000720, A339148 (insulated primes), A339188 (highly insulated primes).
Related sequences: A046929.
Sequence in context: A135990 A347256 A347224 * A345226 A140715 A330690
KEYWORD
nonn,changed
AUTHOR
Abhimanyu Kumar, Nov 29 2020
STATUS
approved