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 A370387 #60 Dec 30 2024 13:17:11 %S A370387 2,19,5,67,7,281,1051,6791,11,115599457,365705201,79352440891, %T A370387 286351937491,5810592517241,17,1942721697854617 %N A370387 a(n) is the least prime p such that p + 6*k*(k+1) is prime for 0 <= k <= n-1 but not for k=n. %C A370387 a(10), ..., a(14) > 10^7, a(15) = 17, a(16), ..., a(20) > 10^7. %C A370387 a(29) = 31. - _Chai Wah Wu_, Apr 10 2024 %p A370387 f:= proc(p) local k; %p A370387 for k from 1 while isprime(p+k*(k+1)*6) do od: %p A370387 k %p A370387 end proc: %p A370387 A:= Vector(12): count:= 0: %p A370387 for i from 1 while count < 12 do %p A370387 v:= f(ithprime(i)); %p A370387 if A[v] = 0 then count:= count+1; A[v]:= ithprime(i) fi %p A370387 od: %p A370387 convert(A,list); %t A370387 Table[p=1;m=6;Monitor[Parallelize[While[True,If[And[MemberQ[PrimeQ[Table[p+m*k*(k+1),{k,0,n-1}]],False]==False,PrimeQ[p+m*n*(n+1)]==False],Break[]];p++];p],p],{n,1,10}] %o A370387 (PARI) isok(p, n) = for (k=0, n-1, if (! isprime(p + 6*k*(k+1)), return(0))); return (!isprime(p + 6*n*(n+1))); %o A370387 a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p; %o A370387 (Perl) use ntheory qw(:all); sub a { my $n = $_[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($_ + 6*$n*($n+1)) } sieve_prime_cluster($lo, $hi, map { 6*$_*($_+1) } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " } # _Daniel Suteu_, Dec 30 2024 %Y A370387 Cf. A164926, A371024. %K A370387 nonn,more %O A370387 1,1 %A A370387 _J.W.L. (Jan) Eerland_, Mar 12 2024 %E A370387 a(10)-a(11) from _Chai Wah Wu_, Apr 10 2024 %E A370387 a(12) from _Chai Wah Wu_, Apr 11 2024 %E A370387 a(13)-a(14) from _David A. Corneth_, Apr 11 2024 %E A370387 a(15) from _J.W.L. (Jan) Eerland_, Mar 12 2024 %E A370387 a(16) from _Daniel Suteu_, Dec 30 2024