This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A339096 #17 Mar 07 2024 08:52:21 %S A339096 5,7,11,23,701,3989,4397,5501,7309,9281,10331,11243,12907,16127,27917, %T A339096 39901,43051,44843,48397,66569,70657 %N A339096 Record values in A306400. %e A339096 a(3) = 11 is in the sequence because A306400(5) = 11 and A306400(k)<11 for k < 5. %p A339096 g:= proc(p) local q; %p A339096 q:= 3: %p A339096 do %p A339096 q:= nextprime(q); %p A339096 if isprime(p+q^2-1) and isprime(p+q^2+1) then return q fi; %p A339096 od %p A339096 end proc: %p A339096 R:= NULL: count:= 0: w:= 0: %p A339096 for nn from 5 by 6 while count < 15 do %p A339096 if isprime(nn) then %p A339096 v:= g(nn); %p A339096 if v > w then count:= count+1; R:= R, v; w:= v; fi %p A339096 fi %p A339096 od: %p A339096 R; %t A339096 g[p_] := Module[{q}, q = 3; While[True, q = NextPrime[q]; If [PrimeQ[p + q^2 - 1] && PrimeQ[p + q^2 + 1], Return@q]]]; %t A339096 R = {}; count = 0; w = 0; %t A339096 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]]]; %t A339096 R (* _Jean-François Alcover_, Mar 07 2024, after _Robert Israel_ *) %Y A339096 Cf. A306400. %K A339096 nonn,more %O A339096 1,1 %A A339096 _Robert Israel_, Nov 23 2020 %E A339096 a(16)-a(17) from _Jinyuan Wang_, Dec 04 2020 %E A339096 a(18)-a(21) from _Chai Wah Wu_, Jan 15 2021