login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A339096
Record values in A306400.
0
5, 7, 11, 23, 701, 3989, 4397, 5501, 7309, 9281, 10331, 11243, 12907, 16127, 27917, 39901, 43051, 44843, 48397, 66569, 70657
OFFSET
1,1
EXAMPLE
a(3) = 11 is in the sequence because A306400(5) = 11 and A306400(k)<11 for k < 5.
MAPLE
g:= proc(p) local q;
q:= 3:
do
q:= nextprime(q);
if isprime(p+q^2-1) and isprime(p+q^2+1) then return q fi;
od
end proc:
R:= NULL: count:= 0: w:= 0:
for nn from 5 by 6 while count < 15 do
if isprime(nn) then
v:= g(nn);
if v > w then count:= count+1; R:= R, v; w:= v; fi
fi
od:
R;
MATHEMATICA
g[p_] := Module[{q}, q = 3; While[True, q = NextPrime[q]; If [PrimeQ[p + q^2 - 1] && PrimeQ[p + q^2 + 1], Return@q]]];
R = {}; count = 0; w = 0;
For[nn = 5, count < 15, nn = nn + 6, If[PrimeQ[nn], v = g[nn]; If[v > w, count++; Print[count, " ", v]; R = Append[R, v]; w = v]]];
R (* Jean-François Alcover, Mar 07 2024, after Robert Israel *)
CROSSREFS
Cf. A306400.
Sequence in context: A181602 A075705 A340308 * A249735 A218394 A067289
KEYWORD
nonn,more
AUTHOR
Robert Israel, Nov 23 2020
EXTENSIONS
a(16)-a(17) from Jinyuan Wang, Dec 04 2020
a(18)-a(21) from Chai Wah Wu, Jan 15 2021
STATUS
approved