OFFSET
1,1
COMMENTS
LINKS
François Marques, 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. See p. 610.
EXAMPLE
For the triplet (13,23,37) of insulated primes, the values of degree of insulation are D(13)=2, D(23)=4, and D(37)=3. Hence, 23 is the highly insulated prime.
MATHEMATICA
Block[{s = {0}~Join~Array[Min[NextPrime[# + 1] - # - 1, # - NextPrime[# - 1, -1]] &@ Prime@ # &, 660, 2], t}, t = Array[If[#1 < #2 > #3, #4, Nothing] & @@ Append[s[[# - 1 ;; # + 1]], #] &, Length@ s - 2, 2]; Array[If[s[[#1]] < s[[#2]] > s[[#3]], #4, Nothing] & @@ Append[t[[# - 1 ;; # + 1]], Prime@ t[[#]]] &, Length@ t - 2, 2] ] (* Michael De Vlieger, Dec 11 2020 *)
PROG
(PARI)
A339188(n) = { \\ Return the list of the first n highly insulated primes
my( HighInsulated=List([]), D(p)=min(nextprime(p+1)-p-1, p-precprime(p-1)); );
my( Dpred_ins=D(7), Pcur_ins=13, Dcur_ins=D(Pcur_ins) );
local( Dpred=D(Pcur_ins), p=nextprime(Pcur_ins+1), Dp=D(p), Pnext=nextprime(p+1), Dnext=D(Pnext) );
my(SearchNextInsulated() =
until(Dp > max(Dpred, Dnext),
Dpred = Dp; p = Pnext; Dp = Dnext;
Pnext = nextprime(p+1); Dnext = D(Pnext);
);
\\ At this point p is the first insulated prime > Dcur_ins
);
while(#HighInsulated<n,
until(Dcur_ins > max(Dpred_ins, Dp),
Dpred_ins = Dcur_ins; Pcur_ins = p; Dcur_ins = Dp;
SearchNextInsulated();
);
listput(HighInsulated, Pcur_ins);
);
return(HighInsulated);
} \\ François Marques, Dec 01 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Abhimanyu Kumar, Nov 27 2020
STATUS
approved